centos7 mysql various error

1, reset the root password

     we /etc/my.cnf

    Add skip-grant-tables

   service mysqld restart

    

2, mysql login

     1 error

        Unknown system variable 'validate_password_policy'      

    2 error

      Command line can not enter the command prompt You must reset your password using ALTER USER statement before executing this statement.

   Error 3

     ERROR 1819 (HY000): Your password does not satisfy the current policy requirements。

3, the solution:

    For the first time set a complex password (mysql default is Intermediate MEDIUM) Root_12root

    

 

   1\   use mysql

   2\  update user set authentication_string = password("Root_12root") where user = 'root'

  4 \ Restart

  5, with the new password,

  6  、

      alter user 'root'@'localhost' identified by 'Root_12root' 

    

 

Guess you like

Origin www.cnblogs.com/cbugs/p/10975264.html