Can the mysql client remotely connect to the mysql database server? The answer is of course yes. The following describes how to connect the mysql client software to a remote server for your reference.
We are all used to installing Mysql on our own machine, and then using the mysql client software to connect. Today we tried to connect to a remote mysql database server, and a string of English is displayed, it means that the client is not licensed and cannot access the database. This solution is used:
1. Go to mysql and create a new user kay:
2. Format: grant permission on database name. Table name user @ login host identified by "User Password ";
Grant select, update, insert, delete on *. * to kay@192.168.1.8 identified by "kaypass ";
3. view the result and execute:
Use mysql;
Select host, user, password from user;
We can see that the kay user just created already exists in the user table. The host field indicates the host to log on to. The value can be an IP address or a host name,
Changing the value of the host field to % indicates that you can log on to the mysql server as a kay user on any client machine. We recommend that you set the value to % during development.
Update user set host = '%' where user = 'Kay ';
Another method is as follows ::
A../mysqladmin-uroot-p21century reload
./Mysqladmin-uroot-p21century shutdown
B../mysqld_safe -- user-root &
Remember: Any modification to the authorization table must be reload again, that is, step 1.
If you still cannot connect from the client after the above three steps, perform the following operations to insert a record in the db table of the mysql database:
Use mysql;
Insert into db values ('2017. 168.88.234 ',' % ', 'xuys', 'y ', 'y', 'y ');
Update db set host = '%' where user = 'xuys ';
Repeat steps 2nd and 3 above.
How to Create a master-slave server for mysql
Provides you with an in-depth understanding of MySQL ifnull () Functions
Use of mysql benchmark Function
SQL Aggregate functions
Use of the concat_ws function in MySQL