sudo apt-get update  #更新源
sudo apt-get install mysql-server #安装

create user 'root'@'%' identified by '123456';
grant all privileges on *.* to 'root'@'%';
alter user 'root'@'localhost' identified with mysql_native_password by '123456';
flush privileges;


create database swtest;
create user 'swadmin'@'%' identified by 'p@ssw0rd@sw';
grant all privileges on *.* to 'swadmin'@'%' with grant option;
flush privileges;


alter user 'root'@'%' identified with mysql_native_password by '123456';

 

安装说明:

mysqld install MySQL3303  --defaults-file="C:\Program Files\MySQL\8.0.18\MySQL3303.ini"
mysqld install MySQL3306  --defaults-file="C:\Program Files\MySQL\8.0.18\MySQL3306.ini"

mysqld --defaults-file="C:\Program Files\MySQL\8.0.18\MySQL3303.ini" --initialize --console
mysqld --defaults-file="C:\Program Files\MySQL\8.0.18\MySQL3306.ini" --initialize --console 

net start MySQL3303
net start MySQL3306

mysql -P3303 -uroot -p
输入原始密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
flush privileges;
use mysql;
select host, user, plugin from user;

mysql -P3306 -uroot -p
输入原始密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
flush privileges;
use mysql;
select host, user, plugin from user;



卸载说明:
mysqld -nt -remove "MySQL3303"
net stop "MySQL3303"
sc delete MySQL3303

 

相关文章:

  • 2021-05-21
  • 2021-12-18
  • 2022-12-23
  • 2021-11-11
  • 2021-11-11
  • 2021-11-02
  • 2021-05-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2021-08-26
  • 2021-09-25
  • 2021-05-10
  • 2021-12-10
相关资源
相似解决方案