windows下mysql的安装
Windows下安装mysql
1.去官网下载zip
2.解压缩zip
3.增加my.ini 并配置basedir datadir [只配置少数参数]
不要配置
binlog_format = row
server_id = 3306
gtid_mode = ON
enforce_gtid_consistency = ON
可以配置
# 设置3306端口
port=3306
# 设置mysql的安装目录
basedir=D:\\mysql8012\\mysql-8.0.12-winx64
# 设置mysql数据库的数据的存放目录
datadir=D:\\mysql8012\\mysql-8.0.12-winx64\\data
4.cmd进入bin目录
D:\mysql812\mysql-8.0.12-winx64\bin>mysqld --initialize --console
2018-09-23T08:36:11.496890Z 0 [System] [MY-013169] [Server] D:\mysql812\mysql-8.0.12-winx64\bin\mysqld.exe (mysqld 8.0.12) initializing of server in progress as process 24152
2018-09-23T08:36:14.774074Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: Cs;DgPzBy7(3
2018-09-23T08:36:15.979576Z 0 [System] [MY-013170] [Server] D:\mysql812\mysql-8.0.12-winx64\bin\mysqld.exe (mysqld 8.0.12) initializing of server has completed
5.用管理员权限打开cmd
6.mysqld --install mysql812
7.进入注册表(regedit)
8.计算机\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mysql812
修改参数
#"D:\mysqlt8\mysql-8.0.12-winx64\bin\mysqld" --defaults-file="D:\mysql812\mysql-8.0.12-winx64\my.ini" mysql812
9.进入service.msc 启动mysql812
10.登陆mysql
11.ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
12.flush privileges;
13.关闭数据库服务
14.新增所有参数 重新打开数据库服务 [这时才会产生二进制日志]