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,
ramrocketAsked:
Who is Participating?
 
todd_farmerCommented:
So sorry - try this:

SHOW GRANTS;
0
 
todd_farmerCommented:
GRANT ALL ON db_name.* TO 'user'@'%' IDENTIFIED BY 'password';
0
 
snoyes_jwCommented:
GRANT ALL ON *.* TO 'username'@'%' IDENTIFIED BY 'password';
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
ramrocketAuthor Commented:
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)
0
 
ramrocketAuthor Commented:
I am logged in to the cpanel as "spatial"
0
 
snoyes_jwCommented:
You may need to specify the database to which you have rights.  See post by todd_farmer above.
0
 
ramrocketAuthor Commented:
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'
0
 
todd_farmerCommented:
Check to make sure you have the GRANT OPTION for your account:

SHOW PERMISSIONS;
0
 
ramrocketAuthor Commented:
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
0
 
ramrocketAuthor Commented:
Grant looks like:
GRANT USAGE ON *.* TO 'spatial'@'localhost' IDENTIFIED BY PASSWORD '719048d343eed738'
0
 
ramrocketAuthor Commented:
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?
0
 
snoyes_jwCommented:
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
0
 
ramrocketAuthor Commented:
So, can I still use login remotely using this account or not?
0
 
snoyes_jwCommented:
Not that account, because it is limited to connections from localhost.  You'll need to create a user as shown above, and to do that, you'll need to log in as a user that has permissions to create users and grant privileges.
0
 
ramrocketAuthor Commented:
Thanks guys, I split the points to both of you.  Now I know what to do.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.