Link to home
Start Free TrialLog in
Avatar of ramrocket
ramrocket

asked on

Create a User

I want to create a user that can acesss MySQL from any remote machine.  Just can't seem to find a way in my MyPHPAdmin 4.0.  Can you give the steps including grant privilege?


many thanks,
Avatar of todd_farmer
todd_farmer
Flag of United States of America image

GRANT ALL ON db_name.* TO 'user'@'%' IDENTIFIED BY 'password';
GRANT ALL ON *.* TO 'username'@'%' IDENTIFIED BY 'password';
Avatar of ramrocket
ramrocket

ASKER

I typed this in my sql query window:
GRANT ALL ON * . * TO 'NetUser'@'%' IDENTIFIED BY '12345'

I get this error:
#1045 - Access denied for user 'spatial'@'localhost' (using password: YES)
I am logged in to the cpanel as "spatial"
You may need to specify the database to which you have rights.  See post by todd_farmer above.
I tried Todd's suggestion also but got a diff error:

GRANT ALL ON test . * TO 'NetUser'@'%' IDENTIFIED BY '12345'

#1044 - Access denied for user 'spatial'@'localhost' to database 'test'
Check to make sure you have the GRANT OPTION for your account:

SHOW PERMISSIONS;
Sorry I am new to MySQL.  

I type SHOW PERMISSIONS in my SQL query window and got this

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PERMISSIONS' at line 1
ASKER CERTIFIED SOLUTION
Avatar of todd_farmer
todd_farmer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Grant looks like:
GRANT USAGE ON *.* TO 'spatial'@'localhost' IDENTIFIED BY PASSWORD '719048d343eed738'
If I want to use this username as a remote login, what grant options do I need to give this user?  and how to do that?
Ah.  That user does not have permission to grant privileges to other users.  'USAGE' is a synonym for 'no privileges'.
http://dev.mysql.com/doc/refman/5.0/en/grant.html
So, can I still use login remotely using this account or not?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks guys, I split the points to both of you.  Now I know what to do.