Linux下MySQL 5.7的初始化

1.登录root账号
su

2.启动MySQL服务
systemctl start mysql

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

4.登录MySQL
mysql -u root #无密码
mysql -u root -p #有密码

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

原文地址:https://www.cnblogs.com/live41/p/13833320.html