Linux下MySQL 5.7的初始化

要用管理员账号运行。

systemctl start mysql
#启动MySQL服务

mysqld_safe --user=mysql &
#启动MySQL服务(安全方式)

mysql -u root -p
#登录MySQL(有密码)

mysql -u root
#登录MySQL(无密码)


成功进入MySQL。

update mysql.user set authentication_string=password('我的密码') where user='root' and Host = 'localhost';
#修改指定服务端的密码

猜你喜欢

转载自www.cnblogs.com/maluscalc/p/10115380.html