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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

todd_farmerCommented:
GRANT ALL ON db_name.* TO 'user'@'%' IDENTIFIED BY 'password';
snoyes_jwCommented:
GRANT ALL ON *.* TO 'username'@'%' IDENTIFIED BY 'password';
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)
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

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

SHOW PERMISSIONS;
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
todd_farmerCommented:
So sorry - try this:

SHOW GRANTS;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ramrocketAuthor Commented:
Grant looks like:
GRANT USAGE ON *.* TO 'spatial'@'localhost' IDENTIFIED BY PASSWORD '719048d343eed738'
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?
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
ramrocketAuthor Commented:
So, can I still use login remotely using this account or not?
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.
ramrocketAuthor Commented:
Thanks guys, I split the points to both of you.  Now I know what to do.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.