• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

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,
0
ramrocket
Asked:
ramrocket
  • 8
  • 4
  • 3
2 Solutions
 
todd_farmerCommented:
GRANT ALL ON db_name.* TO 'user'@'%' IDENTIFIED BY 'password';
0
 
snoyes_jwCommented:
GRANT ALL ON *.* TO 'username'@'%' IDENTIFIED BY 'password';
0
 
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
Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

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

SHOW GRANTS;
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

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

  • 8
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now