Blogger Information
Blog 2
fans 0
comment 0
visits 1350
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
windows安装mysql8
西柚
Original
612 people have browsed it

windows安装mysql8

第一步:
  下载后将文件解压到想安装位置D:\mysql-8.0.12-winx64
第二步:设置环境变量
  变量名:MYSQL_HOME
  变量值:D:\mysql-8.0.12-winx64\mysql-8.0.12-winx64
  变量名:Path
  变量值:%MYSQL_HOME%\bin
第三步:配置初始化my.ini
  在D:\mysql-8.0.12-winx64\mysql-8.0.12-winx64中新建my.ini
并添加以下内容

  1. [mysqld]
  2. # 设置3306端口
  3. port=3306
  4. # 设置mysql的安装目录
  5. basedir=D:\mysql-8.0.12-winx64\mysql-8.0.12-winx64
  6. # 设置mysql数据库的数据的存放目录
  7. datadir=D:\MySQL\Data
  8. # 允许最大连接数
  9. max_connections=200
  10. # 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统
  11. max_connect_errors=10
  12. # 服务端使用的字符集默认为UTF8
  13. character-set-server=utf8mb4
  14. # 创建新表时将使用的默认存储引擎
  15. default-storage-engine=INNODB
  16. # 默认使用“mysql_native_password”插件认证
  17. default_authentication_plugin=mysql_native_password
  18. [mysql]
  19. # 设置mysql客户端默认字符集
  20. default-character-set=utf8mb4
  21. [client]
  22. # 设置mysql客户端连接服务端时默认使用的端口
  23. port=3306
  24. default-character-set=utf8mb4

第四步:以管理员身份运行cmd
  d:回车
  cd D:\mysql-8.0.12-winx64\mysql-8.0.12-winx64\bin
   mysqld —initialize —console //生成数据库默认密码,复制保存
第五步:启动MySql服务
  net start mysql
第六步:登录MySQL数据库
  mysql -u root -p

修改root密码 (123456) ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

MySQL卸载
1.在 Windows 命令提示符下运行:
停止: net stop MySQL
卸载: sc delete MySQL
2.开始->运行-> regedit 看看注册表里这几个地方删除没有
  HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQLD Service 目录删除

  HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL 目录删除

  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MySQL 目录删除

3、win10系统,打开C盘,找到ProgramData 删除有关MySQL

启动mysql时显示:服务名无效

解决:

STEP1:进入mysql安装的目录下D:\mysql-8.0.12-winx64\mysql-8.0.12-winx64;进入bin目录

STEP2:mysqld —remove

STEP3:mysqld —install

提示:Service successfully installed.

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post