1. 首先进入官网下载地址:https://dev.mysql.com/downloads/mysql/
进入mysql\bin目录下输入命令
mysqld --initialize-insecure --user=mysql
mysqld -remove || mysqld -install
net start mysql
mysql -uroot -p
(会提示输入密码,直接按回车)
生成data文件夹:并且 xxx.err文件存放mysql用户密码
--------------------------
在mysql根目录下新建my.ini文件,并把一下内容复制进去
[mysqld]
character-set-server=utf8
[mysql]
default-character-set = utf8
[mysql.server]
default-character-set = utf8
[mysqld_safe]
default-character-set = utf8
[client]
default-character-set = utf8
修改用户名密码:
https://www.cnblogs.com/laremehpe/p/16911467.html
--------------------------------
添加多个版本的mysql :
到第二个mysql的bin目录下执行:
mysqld install mysql5
mysql5随便起
打开注册表编辑器,找到对应mysql路径:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mysql5
双击ImagePath修改路径:
D:\Desktop\project\mysql-5.7.44-winx64\bin\mysqld mysql5
启动:
net start mysql5
停止:
net start mysql5