Before you can use a MySQL database you need to create it and a user to access it. You can do this from your Hosting control panel. When you create a database and username your Hosting control panel automatically prefixes them with your Hosting control panel username. Follow the steps below, replacing “user” with your Hosting control panel username.
- Login to your Hosting control panel
- Click “MySQL Databases”
- Next to “Db:” type a database name (e.g. “db”) and click “Add Db”
- Return to the “MySQL Databases” page
- Under “Users” type a username (e.g. “me”) and a password and click “Add User”
- Return to the “MySQL Databases” page
- Select the newly created user (e.g. “user_me”) and the newly created database (e.g. “user_db”) and click “Add User to Db”
- Add '%' to access hosts, this will allow the users to connect to the database
Now use the following details to connect to the database:
- Server: localhost
- User: user_me
- Database: user_db
- Password: The password you entered when you created user_me
- 58 Users Found This Useful