mysql root password
""" centos: mysql忘记root密码解决 1.修改MySQL的登录设置: # vim /etc/my.cnf 在[mysqld]的段中加上一句:skip-grant-tables 例如: [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock skip-grant-tables 2.重启mysql systemctl restart mysqld.service 3.登录mysql mysql 4.修改root用户密码: 先将密码设置为空 update user set authentication_string='' where user='root' 再修改密码 ALTER user 'root'@'localhost' IDENTIFIED BY 'Cliu123#' 如果遇到The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement 则刷新权限即可(FLUSH PRIVILEGES) 注意: 一定不要采取如下形式该密码: use mysql; update user set authentication_string="newpassword"