0%

不同版本MySQL共存

为了不同版本的mysql共存,需要配置不同的端口号

使用命令时也要区分在不同的bin位置下运行命令

1
2
3
4
5
6
PS D:\MySQL\MySQLServer8.0.25> D:\MySQL\MySQLServer8.0.25\bin\mysqld.exe --defaults-file=D:\MySQL\MySQLServer8.0.25\my.ini --initialize --console
2021-06-06T05:31:15.098191Z 0 [System] [MY-013169] [Server] D:\MySQL\MySQLServer8.0.25\bin\mysqld.exe (mysqld 8.0.25) initializing of server in progress as process 29128
2021-06-06T05:31:15.099370Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2021-06-06T05:31:15.106060Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-06-06T05:31:26.211060Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-06-06T05:31:43.080360Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: bDGxPt=tL0jy
1
PS D:\MySQL\MySQLServer8.0.25> D:\MySQL\MySQLServer8.0.25\bin\mysqld install MYSQL80 --defaults-file=D:\MySQL\MySQLServer8.0.25\my.ini

登录时也要区分

1
PS D:\MySQL\MySQLServer8.0.25> D:\MySQL\MySQLServer8.0.25\bin\mysql -P3307 -uroot -p

修改临时密码

set password for root@localhost=password('123456');

如果失效,可以用ALTER USER'root'@'localhost' IDENTIFIED BY '123456';