Connect the mysql client to the remote database server

Source: Internet
Author: User
We are all used to installing MySQL on our own machine, and then using sqlyog and other client software to connect. Today we tried to connect to a remote MySQL database server. The result is a string of English letters, it seems that the client is not licensed and cannot access the database. I searched on Google and used this method to solve the problem:
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: (I have not tried it for your reference only ):
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.

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.