1. 程式人生 > >Win7安裝解壓版MySQL

Win7安裝解壓版MySQL

img images ica from lan pan 操作 mov 用戶

1. 下載MySQL

訪問https://dev.mysql.com/downloads/mysql/5.6.html#downloads,下載操作系統對應的版本(無賬號需先註冊一個),以mysql-5.6.38-win32為例

2.解壓

以解壓到D:\soft_dev\mysql-5.6.38-win32為例

3.修改配置文件

解壓完mysql-5.6.38-win32目錄下有一個配置文件模板my-default.ini,直接修改該文件即可

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It‘s a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
 basedir = D:\soft_dev\mysql-5.6.38-win32
 datadir = D:\soft_dev\mysql-5.6.38-win32\data
# port = .....
# server_id = .....


# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
 join_buffer_size = 128M
 sort_buffer_size = 2M
 read_rnd_buffer_size = 2M 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

4.安裝MySQL服務

進入D:\soft_dev\mysql-5.6.38-win32\bin目錄,執行mysqld.exe -install安裝服務(如果360安全衛士有監測,允許本次操作),mysqld.exe -remove移除服務,效果可在windows服務列表中查看

技術分享

5.啟動服務

任意位置執行net start mysql

技術分享

此時再查看Windows服務列表MySQL狀態為啟動,且啟動類型為自動

技術分享

6.遠程登陸用戶設置

進入D:\soft_dev\mysql-5.6.38-win32\bin目錄,執行mysql -uroot,進入mysql,此時為root免密登錄

mysql> use mysql;

mysql> select host,user,password from user;

mysql> update user set password=password(‘123456‘) where user=‘root‘;

mysql> update user set host=‘%‘ where user=‘root‘ and host=‘localhost‘;

mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘123456‘ WITH GRANT OPTION;

mysql> flush privileges;

mysql> exit

Win7安裝解壓版MySQL