最新消息:XAMPP默认安装之后是很不安全的,我们只需要点击左方菜单的 "安全"选项,按照向导操作即可完成安全设置。

mysql绿色版下载安装配置代码教程

XAMPP教程 admin 238浏览 0评论

1.mysql.org官网下载

解压下载好的压缩包

下载地址 mysql-5.6.26-win64 绿色版

copy 一份my-default.ini改名字为my.ini为mysql的配置文件

打开my.ini 修改配置文件

默认的原版文件为

  1. # For advice on how to change settings please see
  2. # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
  3. # *** DO NOT EDIT THIS FILE. It’s a template which will be copied to the
  4. # *** default location during install, and will be replaced if you
  5. # *** upgrade to a newer version of MySQL.
  6. [mysqld]
  7. # Remove leading # and set to the amount of RAM for the most important data
  8. # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
  9. # innodb_buffer_pool_size = 128M
  10. # Remove leading # to turn on a very important data integrity option: logging
  11. # changes to the binary log between backups.
  12. # log_bin
  13. # These are commonly set, remove the # and set as required.
  14. # basedir = …..
  15. # datadir = …..
  16. # port = …..
  17. # server_id = …..
  18. # Remove leading # to set options mainly useful for reporting servers.
  19. # The server defaults are faster for transactions and fast SELECTs.
  20. # Adjust sizes as needed, experiment to find the optimal values.
  21. # join_buffer_size = 128M
  22. # sort_buffer_size = 2M
  23. # read_rnd_buffer_size = 2M
  24. sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

修改为(黄色高亮部分)

  1. # For advice on how to change settings please see
  2. # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
  3. # *** DO NOT EDIT THIS FILE. It’s a template which will be copied to the
  4. # *** default location during install, and will be replaced if you
  5. # *** upgrade to a newer version of MySQL.
  6. [mysqld]
  7. # Remove leading # and set to the amount of RAM for the most important data
  8. # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
  9. # innodb_buffer_pool_size = 128M
  10. # Remove leading # to turn on a very important data integrity option: logging
  11. # changes to the binary log between backups.
  12. # log_bin
  13. # These are commonly set, remove the # and set as required.
  14. basedir = “C:\work\mysql-5.6.26-winx64\mysql-5.6.26-winx64″
  15. datadir = “C:\work\mysql-5.6.26-winx64\mysql-5.6.26-winx64\data”
  16. # port = …..
  17. # server_id = …..
  18. # Remove leading # to set options mainly useful for reporting servers.
  19. # The server defaults are faster for transactions and fast SELECTs.
  20. # Adjust sizes as needed, experiment to find the optimal values.
  21. # join_buffer_size = 128M
  22. # sort_buffer_size = 2M
  23. # read_rnd_buffer_size = 2M
  24. sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
  25. #服务端的编码方式
  26. character-set-server=utf8
  27. [client]
  28. #客户端编码方式,最好和服务端保存一致
  29. loose-default-character-set = utf8
  30. [WinMySQLadmin]
  31. Server = “C:\work\mysql-5.6.26-winx64\mysql-5.6.26-winx64\bin\mysqld.exe”

修改好配置文件之后

配置环境变量

在path中添加mysql的安装bin目录就好了 (这步骤最好先做)

以管理员身份运行cmd 进入mysql安装的bin的文件夹中,

输入 mysqld -install 运行安装服务 运行成功之后 开启服务,

再次运行cmd 输入mysql -u root -p 密码默认没有 检测是否安装成功

安装成功之后 修改密码 同理以管理员身份运行cmd 进入mysql安装的bin的文件夹中

输入mysqladmin -u root -p password 回车

输入原始密码 再次输入新密码 确认密码 (原始密码初次登陆为空 直接回车就行了)

大功告成

转载请注明:XAMPP中文组官网 » mysql绿色版下载安装配置代码教程