MySQL open user remote connection in Linux

Source: Internet
Author: User
Tags table name

Connect MySQL and run the following command:

The code is as follows Copy Code

Mysql-u root-p
Mysql>use MySQL;
Mysql>select host from user where user= ' root ';
Mysql>update User Set host = '% ' where user = ' root ';
Mysql>flush privileges;
Mysql>select ' host ' from user where user= ' root ';

Note: "Semicolons" behind some commands are not missing!

The first sentence is to log on with the permission user root

Second sentence: choose MySQL Library

The third sentence: View the host value of the user table in the MySQL library (the hosts/IP name for connection access)

Modify host value (increase host/IP address in the content of the wildcard character%), and of course add IP address directly

Refreshing MySQL's system permissions related tables

Sixth: When you view the user table again, there are changes ...

Restart the MySQL service to complete: service mysqld restart

On the action method in Liunx, here's a summary of Windows methods

1, enter MySQL, create a new user xuys:

Format: Grant permission on database name. Table name user @ Login host identified by "User password";

The code is as follows Copy Code
Grant Select,update,insert,delete on *.* to xuys@192.168.88.234 identified by "xuys1234";


View the results and execute:

The code is as follows Copy Code
Use MySQL;
Select Host,user,password from user;


You can see that the Xuys user that you just created is already in the user table. The Host field indicates which hosts are logged on, their values can be IP, and are available

Host name,

Changing the value of the host field to% indicates that the Xuys user can log on to the MySQL server on any client machine, and it is recommended that

Set to%.

Remember that any modifications to the authorization table need to be reload, that is, to perform step 3rd.
  code is as follows copy code
  code is as follows copy code
update user set host = '% ' where user = ' Xuys ';

./mysqladmin-uroot-ppwd Reload
./mysqladmin-uroot-ppwd shutdown
./mysqld_safe--user=root

If you cannot connect from the client through the above 3 steps, insert a record in the DB table of the MySQL database by doing the following

The code is as follows Copy Code

Use MySQL;
INSERT INTO DB

VALUES (' 192.168.88.234 ', '% ', ' xuys ', ' y ', ' y ', ' y ', ' y ', ' y ' ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y-axis ', ' y ', ' y ';
Update db Set host = '% ' where user = ' Xuys ';

Repeat the 2nd and 3 steps above.

IDE tools more convenient, in the EMS MySQL, you can add a remote access to the user can be added, the host to fill in the% on it, and then select the following permissions list

Related reference documents

Http://www.111cn.net/database/mysql/34989.htm

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.