MySQL cannot be remotely logged on to Ubuntu

Source: Internet
Author: User

Q: The following error occurs when I log on to MySQL on another machine:

ERROR 2003 (HY000): Can't connect to MySQL server on 'x. x. x. x' (111)

A: The reason is that, considering the security factors of MySQL, the default configuration only allows local login.

Open the/etc/mysql/my. cnf file and find bind-address = 127.0.0.1 and change it to bind-address = 0.0.0.0.

Restart mysql: sudo/etc/init. d/mysql restart

Refer:

> I 've already check my/etc/my. cnf file for a "binding"
> Line. Its not
> There. I also found an item online that indicated
> Adding:
>

Look for the option "skip-networking". This disables TCP/IP so
Server only accepts local connections via the Unix socket. This sounds
Like your situation.
Note that a "cocould not connect" error means just that. If the problem
Was related to user privileges you wocould get an "access denied" error.

Q: In another case, an error similar to the following occurs:

ERROR 1045 (28000): Access denied for user 'test' @ 'x. x. x. x' (using password: NO)

A: The reason is that you have not set the remote host logon permission for the logon username.

Log on locally with root: mysql-u root-p

Modify the Host field of the username in the user table of MySQL database and change localhost to %

Use mysql;

Update user set Host = '%' where User = 'username ';

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.