An application needs two things: a database to store data in, and a user with permission to use it. Creating one without the other is the most common mistake.
The steps
In cPanel, open MySQL Databases.
- Create the database. Type a short name. Your account name and an underscore are added automatically, so typing "shop" produces something like account_shop. The full name is what your application needs.
- Create a user. Same prefixing applies. Use the password generator rather than inventing one – nothing has to remember it except a configuration file.
- Add the user to the database and grant ALL PRIVILEGES. This step is the one people miss, and without it the application connects and then fails on the first query.
What your application needs
- Database name – the full prefixed name
- Username – the full prefixed name
- Password
- Host – localhost, not your domain name
The name length limit
Database and user names are limited in length, and your account prefix counts toward it. If a long name is rejected, that is why – shorten the part you chose.
One database per application
Do not share one database between two applications unless the software specifically supports it. Separate databases mean you can back up, restore or delete one without touching the other.