当前位置:Gxlcms > 数据库问题 > MySQL安装时忘记密码解决方法

MySQL安装时忘记密码解决方法

时间:2021-07-01 10:21:17 帮助过:34人阅读

文件夹

技术图片

 

 

 

3.复制解压后的文件放入  创建的MySQL文件中

 

技术图片

4.复制后创建如下所示文件

 

 

技术图片

5.复制到my.ini配置文件中

 

  1. <span style="color: rgba(0, 0, 0, 1)">[mysqld]
  2. port</span>=<span style="color: rgba(128, 0, 128, 1)">3306</span><span style="color: rgba(0, 0, 0, 1)">
  3. basedir</span>=<span style="color: rgba(0, 0, 0, 1)">C:\Program Files\MySQL
  4. datadir</span>=<span style="color: rgba(0, 0, 0, 1)">C:\Program Files\MySQL\Data
  5. max_connections</span>=<span style="color: rgba(128, 0, 128, 1)">200</span><span style="color: rgba(0, 0, 0, 1)">
  6. max_connect_errors</span>=<span style="color: rgba(128, 0, 128, 1)">10</span><span style="color: rgba(0, 0, 0, 1)">
  7. character</span>-<span style="color: rgba(0, 0, 255, 1)">set</span>-server=<span style="color: rgba(0, 0, 0, 1)">utf8mb4
  8. </span><span style="color: rgba(0, 0, 255, 1)">default</span>-storage-engine=<span style="color: rgba(0, 0, 0, 1)">INNODB
  9. #mysql_native_password
  10. default_authentication_plugin</span>=<span style="color: rgba(0, 0, 0, 1)">mysql_native_password
  11. [mysql]
  12. </span><span style="color: rgba(0, 0, 255, 1)">default</span>-character-<span style="color: rgba(0, 0, 255, 1)">set</span>=<span style="color: rgba(0, 0, 0, 1)">utf8mb4
  13. [client]
  14. port</span>=<span style="color: rgba(128, 0, 128, 1)">3306</span>
  15. <span style="color: rgba(0, 0, 255, 1)">default</span>-character-<span style="color: rgba(0, 0, 255, 1)">set</span>=utf8mb4

 

 6.把MySQL添加到系统环境变量

技术图片

 

 

 

 

7.初始化MySQL, 运行cmd(管理员方式)然后cd到mysql目录的bin文件夹

 

技术图片

 

 8.输入命令:mysqld --initialize --console  回车

技术图片

 

 

9.最后一步启动MySQL服务器。

技术图片

 

 

 

*如果忘记初始化密码,则重新复制MySQL文件进行初始化密码设置

 

MySQL安装时忘记密码解决方法

标签:图片   地址   image   ror   basedir   innodb   设置   character   mys   

人气教程排行