[root@db01 ~]# mysqld_safe(mysql安全启动方式,用于维护 ) --skip-grant-tables(授权表不加载不做验证) --skip-networking & (把连接层的TCP/IP 连接协议关掉)(&表示后台调用) [root@xiaoyong mysql]# netstat -lnp|grep 330 [root@xiaoyong mysql]# ll /tmp total 128960 srwxrwxrwx 1 mysql mysql 0 Oct 10 12:38 mysql.sock mysql> flush privileges; 把磁盘上的授权表刷到内存 mysql> alter user root@'localhost' identified by '123456'; [root@db01 ~]# pkill mysqld [root@db01 ~]# systemctl start mysqld