MySQL免密登录操作
vi /etc/my.cnf
添加到配置文件里面放在[mysqld]下面
[mysqld]
skip-grant-tables
重启服务
systemctl restart mysql
登录:mysql
mysql> update mysql.user set password=password('root') where user='root' and host='localhost';
再次回到 /etc/my.cnf 把刚才添加的内容 删除了
systemctl restart mysql
mysql -uroot -proot
MariaDB [(none)]> ALTER USER "root"@"localhost" IDENTIFIED BY "chinaskill123";

浙公网安备 33010602011771号