[root@MySQL ~]# mysqladmin -uroot -proot -S /data/3307/mysql.sock password '123'; 其中-p是现在的密码,password 后面跟的是修改后的密码,-S 指定的是socket,如果服务器上只有一个实例,则不需要指定 mysql> set password for root@localhost = password('root'); mysql> update mysql.user set authenticatio…