win10 安装mysql
现在mysql压缩包:https://downloads.mysql.com/archives/community/
在目录下新建my.ini文件,data文件夹,内容如下:
[mysqld]
basedir = F:\mysql-8.0.13-winx64
datadir =F:\mysql-8.0.13-winx64\data
port = 3306
lower_case_table_names = 2
default_authentication_plugin=mysql_native_password
使用管理员身份打开dos窗口(powershell),执行命令:
mysqld.exe --initialize --console
复制结果中的密码:
2019-04-01T06:04:04.796850Z 0 [System] [MY-013169] [Server] D:\mysql-8.0.14-winx64\bin\mysqld.exe (mysqld 8.0.14) initializing of server in progress as process 12764
2019-04-01T06:04:10.085559Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: 3/3FEF)xPFaZ
2019-04-01T06:04:11.442346Z 0 [System] [MY-013170] [Server] D:\mysql-8.0.14-winx64\bin\mysqld.exe (mysqld 8.0.14) initializing of server has completed
然后执行安装命令:
mysqld.exe --install
提示安装成功:
Service successfully installed.
接着启动mysql
net start mysql
mysql启动成功:
MySQL 服务正在启动 ..
MySQL 服务已经启动成功。
最后要修改mysql的密码:
mysql.exe -uroot -p
输入刚才复制的密码,然后修改密码:
alter user 'root'@'localhost' identified with mysql_native_password by 'aaa123';