免密登录mysql

进入 /etc/my.cnf 文件,找到 [mysqld] ,在其后面添加 skip-grant-tables
vi /etc/my.cnf


image.png

重启mysql
systemctl restart mysqld


image.png

重新登录数据库,搞定
mysql -u root -p
image.png

你可能感兴趣的:(免密登录mysql)