Mysql8.0配置Windows

下载mysql8.0

https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.40-winx64.zip

解压

https://blog.meowrain.cn/api/i/2024/12/23/7xjvMn1734921387067625427.webp https://blog.meowrain.cn/api/i/2024/12/23/CXKXps1734921514482877298.webp

https://blog.meowrain.cn/api/i/2024/12/23/9Vnygd1734921571211913165.webp

改配置文件

新建data文件夹

新建my.ini

https://blog.meowrain.cn/api/i/2024/12/23/RV4FtO1734921602414087395.webp

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
[mysqld]
default-time_zone = '+8:00'
basedir=D:\Software\mysql-8.0.40-winx64
datadir=D:\Software\mysql-8.0.40-winx64\data

bind-address=127.0.0.1
mysqlx-bind-address= 127.0.0.1
max_connections=200
max_connect_errors=10
character-set-server=utf8

[mysql]
default-character-set=utf8

[client]
port=3306

执行命令

1
2
cd bin
.\mysqld.exe --initialize --console

https://blog.meowrain.cn/api/i/2024/12/23/I8fwiv1734922240305046027.webp

会出现初始密码,临时存一下

1
./mysqld.exe --install  mysql

点任务栏的搜索,搜服务 https://blog.meowrain.cn/api/i/2024/12/23/hlbqqJ1734921773862202749.webp 打开找Mysql

https://blog.meowrain.cn/api/i/2024/12/23/dgHYLb1734921745998659946.webp

https://blog.meowrain.cn/api/i/2024/12/23/MCuN5W1734921803026369452.webp

连接mysql

1
mysql -u root -p

会提示输入密码,把刚才的临时密码粘进来就行了

然后需要改密码

1
2
alter user 'root'@'localhost' IDENTIFIED BY '123456';
exit

https://blog.meowrain.cn/api/i/2024/12/23/5OtuhK1734921893032409501.webp

1
mysql -u root -p

https://blog.meowrain.cn/api/i/2024/12/23/bpdyfV1734921903786066359.webp

使用图形化

https://blog.meowrain.cn/api/i/2024/12/23/CuUyxb1734922041162631998.webp

点Installer 下载上安装

https://blog.meowrain.cn/api/i/2024/12/23/0kPGzY1734922096991974877.webp

https://blog.meowrain.cn/api/i/2024/12/23/7U5uW61734922122221385518.webp


相关内容

0%