How do I add a new database user to mysql

minendo

Elite Member
Aug 31, 2001
35,560
22
81
Originally posted by: Munchies
Using phpmyadmin. New to this stuff

First go into the database you need to edit. Next choose the correct area of the database to add the user to and click browse. (IE members, users, etc). Finally at the bottom of that screen insert a new row and edit the information on the row.
 

BadNewsBears

Diamond Member
Dec 14, 2000
3,426
0
0
Eh?. I dont have any tables.Under the SQL tab of my database, there is one large text box then a small one with BROWSE next to it
 

kt

Diamond Member
Apr 1, 2000
6,031
1,346
136
First of all, do you have full access to the database with GRANT privileges? If so, then:

In that large text box, type in:

GRANT select,insert,update,delete,create,drop,index,alter,references ON databasename.* TO 'username'@'%' IDENTIFIED BY 'password'

Fill in databasename, username and password with your own information. The "databasename" is the database you want the user to have access to, if you want the user to have global privileges (access to all databases with the privileges as given above) then put "*.*" instead of "databasename.*".
 

BadNewsBears

Diamond Member
Dec 14, 2000
3,426
0
0
I keep getting this after entering it and it confirming a succesful entry.

Could not create a mySQL connection, please check the SQL values entered

MySQL error was : Access denied for user: 'munchies@127.0.0.1' (Using password: YES)
 

kt

Diamond Member
Apr 1, 2000
6,031
1,346
136
That means you don't have FULL access with GRANT privilege to the database server. Is this your own server?
 

kt

Diamond Member
Apr 1, 2000
6,031
1,346
136
By all means, login as root user so you have full grant access. In your phpmyadmin script use root as the login user (the password by default is blank). Then re-run the grant statement again.