Navicat for MySQL remote connection MySQL database 10061, 1045 error

Source: Internet
Author: User

Using Navicat to connect remote MySQL data error:


A friend may come across the use of navicatForMySQL remote connection MySQL database will prompt 10061, 1045 error or 2003-can ' t connect toMySQL on ' 192.168.1.2 ' (10061),The reason for this is that MySQL does not allow remote connections. The simplest way to do this is to copy the code below the MySQL remote Configuration Code grant all privileges on * * to [email protected] '% ' identified by ' your password '; %Indicates that there are many machines. Open Port 3306, set an exception for the firewall, and release 3306.But you have to have root authority, you can also modify the following methods: 1: Locate the My.ini file under the server MySQL folder. Modify bind-address=127.0.0.1 for bind-address=0.0.0.0 (my in MySQL 5.INI, this is not found) 2: Restart the MySQL service. Test connectivity: If you do not add permissions to remote login users for all machines, you will see "1045-access deniedfor user [email protected] (using password:NO) ", which indicates the need to add permissions; Add a command as follows: code to copy Code 1) grant all on * * to User name @"% "identified by" password "; 2)Flushprivileges; Complete the above steps, you can access the MySQL database remotely. If the above approach doesn't work, we can turn on MySQL remote access permission to allow remote connections 1, log in to MySQL database code as follows copy codeMysql-u Root-P View the user table code as follows to copy the codeMysql>UseMysql;D Atabase changedMysql> Select Host,user,Password from user;+--------------+------+-------------------------------------------+| Host | user | Password |+--------------+------+-------------------------------------------+| localhost | Root | *a731aebfb621e354cd41baf207d884a609e81f5e | | 192.168.1.1 | Root | *a731aebfb621e354cd41baf207d884a609e81f5e |+--------------+------+-------------------------------------------+2 Rows in Set (0.00SEC) to see the root user that was created in the user table. The host field represents the logged-on hosts, whose values can be either IP-enabled or host-name, (1Sometimes you want to log in with a local IP, you can change the above host value to your own IP. 2, Implementing a remote connection (authorization method) changing the value of the host field to% means that you can log on to the MySQL server as the root user on any client machine, and it is recommended that you set it to% at development time。 Update user Set host = '% ' WHERE user =' Root '; Change the permissions to all privileges code as follows to copy codeMysql>UseMysql;D Atabase changedMysql> Grant all privileges on * * to [e-mail protected] '% ' identified by ' root '; Query OK, 0 rows affected (0.00 sec) mysql> select Host,user,password from user;+--------- -----+------+-------------------------------------------+| Host | user | Password |+--------------+------+-------------------------------------------+| localhost | Root | *a731aebfb621e354cd41baf207d884a609e81f5e | | 192.168.1.1 | Root | *a731aebfb621e354cd41baf207d884a609e81f5e | | % | Root | *a731aebfb621e354cd41baf207d884a609e81f5e |+--------------+------+-------------------------------------------+3 Rows in Set (0.00 sec) This allows the machine to remotely access the MYSQL.3 on the machine with the user name root password root use Mysql;update user set host = '% ' where user = ' root ' ; This allows the root user to access MySQL at the remote end

Navicat for MySQL remote connection MySQL database 10061, 1045 error

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.