Mysql 5.7 Remote Connection error

Source: Internet
Author: User

CENTOS7 Install mysql5.7 after login error error 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using pas

After the installation of MySQL will have a temporary password to go to the log to view, but check the login to modify the secret or not

ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)

So

1. Stop the MySQL service

Systemctl Stop Mysqld.service

2. Modify configuration file without password login

[HTML] view plain copy

    1. Vi/etc/my.cnf

At the top of the tail plus

[HTML] view plain copy

    1. Skip-grant-tables

Save

3. Start MySQL

[HTML] view plain copy

    1. Systemctl Start Mysqld.service

4, Login Musql

[HTML] view plain copy

    1. Mysql-u Root

Note here do not add-p

5, change the password, mysql5.7 with this syntax

[HTML] view plain copy

    1. Use MySQL;

[HTML] view plain copy

    1. Update Mysql.user set Authentication_string=password (' 123456 ') where user= ' root ';

6, go back to the second step and remove the added

[HTML] view plain copy

    1. Skip-grant-tables

Save the restart MySQL is ok

#########################################################################

In fact, after the default installation of MySQL or in the log to generate a default password in/var/log/mysqld.log

Login to MySQL password reset after getting the default password

[HTML] view plain copy

    1. Set Passwprd=password (' You password ');

If the password level does not match the default level requirements, it is reported

[HTML] view plain copy

    1. Your password does not satisfy the current policy requirements

At this point you need to modify the level and minimum number of default password bits

[HTML] view plain copy

    1. Set global validate_password_policy=0;
    2. Set global validate_password_length=4;

And then I'm going to set the password.

###################

1130 error when connecting remotely

[HTML] view plain copy

    1. Mysql;use MySQL;
    2. Mysql;select ' host ' from user where user= ' root ';
    3. Mysql;update User Set host = '% ' where user = ' root ';
    4. Mysql;flush privileges;
    5. Mysql;select ' host ' from user where user= ' root ';

Mysql 5.7 Remote Connection error

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.