Ubuntu MySQL deny remote connection (10061)

Source: Internet
Author: User

MySQL is installed using Apt-get.

1. Stop the MySQL service

sudo service MySQL stop

2. Modify the configuration file /etc/mysql/mysql.conf.d/mysqld.cnf

Change bind-address = 127.0.0.1 this line to bind-address = 0.0.0.1

3. Log in to MySQL using root

[Email protected]:~$ mysql-u root-pmysql> Grant All on * * to [email protected]"%" " remote login password "mysql> flush privileges;mysql> quit[email Protected]-vm:~$ sudo service mysql restart  # restart MySQL Services

[email protected]% in% means all IPs have connection rights

But the remote login password can be different from the local login password

Set Password for local login

" password for local login "

Initial state

After the modified

Passwords for local logins and remote logins can be different

Lessons Learned: The root-related items in the Mysql.user table are best not to be deleted, I have no intention of deleting one, although I can still log in, but each time I execute the following statement fails

Ubuntu MySQL deny remote connection (10061)

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.