Problems and solutions of remote connection MySQL database

Source: Internet
Author: User

Log in to my Linux server directly with SECURECRT and the following error occurred after connecting to MySQL

Then I log in to MySQL with the root user to view my user information, as follows

There are a number of reasons for the problem 1, I am here because of the wrong yanglibin this user's password, with the correct password is OK

For more details please see http://blog.csdn.net/lioncode/article/details/7917310 (all that is said)

The blog also mentions a common problem is that MySQL cannot log in remotely,

That is, "Cause 2: The user account exists, but the remote access permission is not granted to the IP of the client on which it resides"

To simulate this situation, I created a user testmysql as follows

Prompt for error messages as follows

In this case, the "Cause 2" solution, as the blog says, is to give the Testmysql user permission to log on to all of its machines.

Note: The premise of authorizing users in the following way is that there is no other testmysql user in the Mysql.user table, otherwise it is easy to error

For testing convenience I have built another user testmysql1;

Finally found that with TESTMYSQL1 this user is still unable to login MySQL, from the blog in the following found a method, that is, testmysql1 this user's password to empty

Update Mysql.user Set Password = Password (") where user= ' TESTMYSQL1 ';

Then go to the landing on it, not quite clear why, very confused

This time has been able to use remote links, such as using SECURECRT with TESTMYSQL1 users to log on to MySQL, can be done, but with this user through Navicat this software to connect to MySQL will prompt the following error

At this point, I found a lot of online solutions to this problem, such as

http://kiddwyl.iteye.com/blog/67708

Http://zhidao.baidu.com/link?url=0hbT0VywNqcmN1uiONFtca7qPjDcgdAi4zZgt6Yc86A1Tsm97o9UqWC4T0uiziSjuDdsD4aquJjITzERn1Y8la

Http://zhidao.baidu.com/link?url=tO_HElduXYDtdRNgib9Ce07WNFVfaYq7mTLiixf8onfSqvHgpWTSxTy9HZ0Mgy__q2hybelglVArvxlFi4c-p_

But can not solve my problem, there is no way only to continue to find, inadvertently see it is possible because the local machine Port 3306 is occupied, according to this hint to try to change the next/etc/my.cnf

As follows:

Vim/etc/my.cnf

Again to use Navicat to connect MySQL, of course, this is just a test case in order to explain the problem, the formal situation will not change the MySQL port number

An article on MySQL user rights is also recommended

http://blog.csdn.net/mchdba/article/details/45934981

Problems and solutions of remote connection MySQL database

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.