MySQL tutorial add a remote user or allow remote access to three ways
Log in with the root user, and then:
Grant all privileges the username @ "%" identified by "password" *.* to create;
Flush privileges; * Refresh the content just now *
Format: Grant permission on database tutorial name. table name to user @ Login host identified by "User password";
@ The client IP address (or hostname) that accesses MySQL is followed by any client, if the localhost is filled
Local access (that user will not be able to access the MySQL database remotely).
You can also set whether or not you have remote access permissions for existing users. As follows:
Use MySQL;
Update db Set host = '% ' where user = ' username '; (If written as host=localhost, this user does not have remote access permission)
Flush privileges;
Grant all privileges in *.* to ' myuser ' @ '% ' identified by ' mypassword ' with GRANT option;
Method Two
1. Add using the GRANT statement: first use root on database native
Login to MySQL (I am using remote Control Linux server, equivalent to login on the server native to MySQL), and then enter:
Mysql>grant all privileges in *.* to admin@localhost identified by ' something ' with GRANT option;
Add a user admin and authorize access via local machine (localhost), password "something".
Mysql>grant all privileges in *.* to admin@ "%" identified by ' something ' with GRANT option;
Add a user admin and authorize access (wildcard%) that can be initiated from any other host. Use this statement.
2. Use INSERT statement:
Mysql>insert into user values ('% ', ' admin ', password (' something '), ' y ', ' y ', ' y ', ' y ', ' y ', and ' Y '),
' Y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y '
User information can be viewed in the users table in the MySQL database, which is not covered here. Count the number of Y, OH.
OK, use the Admin account connection to try, I was repeatedly tried repeatedly success Oh, hehe!
Method Three
Add remote user admin password to password
Grant all privileges on *.* to admin@localhost identified by ' Password ' with GRANT option
Grant all privileges on *.* to admin@ "%" identified by ' Password ' with GRANT option
As a result of project development requirements Database design has to use remote mode. However, the remote settings for the database are not that simple, and the project's database is mysql5.0. Just started to think that as long as the database server can be used for remote links, but the MySQL settings are for the user's security, the system default setting is not allow remote users to connect, only local users. As long as we set the system administrator user's host this value can be given to the remote user access.