Using phpMyAdmin to Create a MySQL Database, User, Password

Posted: 2014-09-23 20:27:59

Make sure Apache and MySQL are running, and access phpmyadmin via URL:
http://127.0.0.1/phpmyadmin

Login with:

Username: root
Password: (leave it blank, it's not set by default)

Click ‘Go’.

* User “root” under WampDeveloper Pro is restricted to local network access in multiple ways, so setting a password is not absolutely necessary.

Create a database:

  1. Click on the ‘Databases’ tab.
  2. Specify a Database name.
  3. Leave everything else as-is (don’t select a collation).
  4. Click ‘Create’.

Create a user:

  1. Click on the newly created database.
  2. Click on its ‘Privileges’ tab.
  3. In ‘New’ group, click ‘Add user’.
User name ('Use text field'): username-here
Host (select 'Use text field'): 127.0.0.1
Password ('Use text field'): password-here
Re-type: password-here

Leave everything else as-is:

'Database for user' group: Grant all privileges on database "database-name".
'Global privileges' group: None

Do not select any “Global” privileges/permissions, as this user only needs all privileges/access on the specific database, and not on all the databases under MySQL.

Click ‘Go’.

Whenever you need to specify this info when you install or configure a web-app or script, make sure to enter the db and user info exactly as above, with “Host” as 127.0.0.1 and not as “localhost”.