mysql5.7 设置不用密码也能登录

使用命令登录mysql    
mysql -u root -p 或 mysql

执行一下命令:
use mysql;
update user set authentication_string=PASSWORD("密码") where user='root';
update user set plugin="mysql_native_password";
flush privileges;
quit;

重启mysql
/etc/init.d/mysql restart;
mysql -u root -p 密码;

更多技术资讯可关注:gzitcast

猜你喜欢

转载自www.cnblogs.com/heimaguangzhou/p/11724290.html