centos skip permission to modify the password

  1. Modify my.cnf configuration sed -i '/ mysqld / a \ skip-grant-tables' /etc/my.cnf 

    centos in mysql root user password modification method
  2. 2

    Restart mysql

    systemctl restart mysqld

    centos in mysql root user password modification method
  3. 3

    Enter mysql

    This time we do not need the root password

    centos in mysql root user password modification method
  4. 4

     use mysql;

    centos in mysql root user password modification method
  5. 5

    UPDATE user SET Password = password('newpassword') where User = 'roo

    centos in mysql root user password modification method
  6. 6

    Refresh rights

    flush privileges; 

    centos in mysql root user password modification method
  7. 7

    drop out

    quit

    centos in mysql root user password modification method
  8. 8

    Restore my.cnf configuration sed -i 's / skip-grant-tables / # skip-grant-tables / g' /etc/my.cnf

    centos in mysql root user password modification method
  9. 9

    Mysql restart the service again

    systemctl restart mysqld

    centos in mysql root user password modification method
  10.  

Guess you like

Origin www.cnblogs.com/tuzaizi/p/11242033.html