Mysql cannot connect to the server from the client

Source: Internet
Author: User


Mysql cannot be connected from the client to the server. The company uses Mysql for a test and starts to build a local Mysql database and connect it to it. No connection failure has been encountered.
When the database is on the server, the connection from the local client is rejected.
ERROR 1130: Host '123456. 168.5.3 'is not allowed to connect to this MySQL server www.2cto.com after checking the information, this problem is usually encountered. The Mysql database is different from other databases, you need to set permissions to control which machine can access the database and which tables can be accessed. Therefore, You need to log on to the server. C: \ Documents ents and Settings \ Administrator> mysql-h localhost-u root-p Enter password: *** Welcome to the MySQL monitor. commands end with; or \ g. your MySQL connection id is 5 Server version: 5.1.43-community MySQL Community Server (GPL) Type 'help; 'or' \ H' for help. type '\ C' to clear the current input statement. www.2cto.com mysql> grant all privileges on *. * to 'root' @ '%' identified by '123' With grant-> option; Query OK, 0 rows affected (0.00 sec) means to grant all resources on the server to the root user, % indicates that the password must be included here. Log On with the password 123. Mysql> flush privileges; Query OK, 0 rows affected (0.00 sec. In this way, the client with the IP address 192.168.5.3 is connected to the author kjqin on the server.

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.