1.下载:
https://dev.mysql.com/downloads/mysql/
2.配置环境变量
3.在E:softwaremysql-8.0.16-winx64创建my.ini
[mysql]
default-character-set=utf8
[mysqld]
port = 3306
basedir=E:softwaremysql-8.0.16-winx64
datadir=E:softwaremysql-8.0.16-winx64data
character-set-server=utf8
default-storage-engine=INNODB
4.以管理员身份运行cmd
cd /d E:softwaremysql-8.0.16-winx64in
mysqld -install
mysqld --initialize-insecure --user=mysql
如果报windows无法启动mysql服务,错误2:系统找不到指定文件
进入注册表编辑器。选择HKEY_LOCAL_MACHINE ->SYSTEM -> CurrentControlSet -> services ->MySQL,修改ImagePath的路径为Mysql安装路径,
5.net start mysql
6.更改密码:mysqladmin -u用户名 -p旧密码 password 新密码