MySQL5.7 Remote connection and add password

Source: Internet
Author: User

Mainly 5.7 of many operations and the previous version is not the same, so tread a lot of pits.

1. remote connection cant connect to MySQL (10061)
    1. Initially thought is a permissions issue, so refer to the detailed MySQL 5.7 new permissions and security issues. Find out or not?
    2. Then, according to the error, refer to a question from Digitalocean. And found that it didn't seem to be my.cnf found.
    3. Feel with Digitalocean described is consistent, then continue to find Conf file, match until.
Solution Solutions

Reference: HTTPS://WWW.JIANSHU.COM/P/93FA9DE59AC1

Finally, the structure of the mysql5.7 configuration file was found to be:

.├── conf.d│   ├── mysql.cnf│   └── mysqldump.cnf├── debian.cnf├── debian-start├── my.cnf -> /etc/alternatives/my.cnf├── my.cnf.fallback├── mysql.cnf└── mysql.conf.d    ├── mysqld.cnf    └── mysqld_safe_syslog.cnf

In the mysqld.cnf file, there is this bind-address configuration.
Change

bind-address  = 127.0.0.1

For

bind-address  = 0.0.0.0
2. Add password special Note that the new version of the MySQL database in the user table has no password field, but the encrypted user password is stored in the Authentication_string field (for reference:/HTTP/ www.jb51.net/article/77858.htm)
Update Mysql.user set Authentication_string=password (' 123qwe ') where user= ' root ';
Flush privileges;
Quit
Service MySQL Restart

MySQL5.7 Remote connection and add password

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.