MySQL 8.0 安装及修改密码

2023/08/0114:45:10MySQL 8.0 安装及修改密码已关闭评论

1. 安装MySQL

sudo apt install mysql-server mysql-client

2. 启动MySQL

sudo systemctl start mysql.service

3. 登录MySQL并修改密码

mysql -uroot
alter user'root'@'localhost' identified with mysql_native_password by 'yourpassword';
flush privileges;

4. 创建账户

# 创建账户
create user root@'%' identified by 'yourpassword';
# 授权用户
grant all privileges on *.* to root@'%';
grant all privileges on *.* to root@localhost;
  • 微信扫码赞助
  • weinxin
  • 支付宝赞助
  • weinxin