How to connect a mysql client to a remote server

Source: Internet
Author: User

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

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.