Mysql免安裝版安裝步驟

1. Mysql官網社區版 下載Mysql免安裝版;

2.解壓到指定文件夾;

3.複製my-small.ini,重命名爲mysql.ini;

4.在[mysqld]下添加 配置(具體以自己的解壓目錄爲準):

# 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.

[mysql]
#設置以下配置相當於同時設置了character_set_client(客戶端)、character_set_connection(連接)、character_set_result(返回結果)的字符集均爲utf8
default_character_set=utf8mb4

#設置客戶端連接的校對規則(排序規則)
#collation_connection=utf8mb4_bin

[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:/software/mysql-5.6.46-winx64"
datadir = "D:/software/mysql-5.6.46-winx64/data"
port = 3310
# server_id = .....

#設置默認時區爲東八區
default_time_zone='+8:00'

#設置服務器級別的字符編碼使用utf8mb4,如不單獨設置數據庫級別、表級別、字段級別的字符集,則默認都使用服務器級別的字符編碼
#建議使用utf8mb4代替之前的utf8,utf8mb4是4個字節的unicode編碼,而utf8最多使用3個字節的unicode編碼,並不是真正的UTF-8編碼,
#會導致部分特殊的字符無法插入
character_set_server=utf8mb4

#設置字符集的校對規則(排序規則)爲大小寫敏感的,不然會導致某些敏感數據不區分大小寫,導致業務上出問題
collation_server=utf8mb4_bin

#修改 發送給服務器的最大數據包大小
max_allowed_packet=20M
#設置表明不區分大小寫(windows下默認都是不區分的,如果配置了會啓動失敗,linux下的話需要設置,不然容易出現表不存在的錯誤,特別是使用quatz等自動生成表的框架,有可能生成的表示大寫的,代碼或者sql使用小寫的去查詢就會報錯)
#lower_case_table_names=0 

# 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 

#解決mysql啓動報timestamp的警告問題,關閉timestamp的默認,如需要DEFAULT CURRENT_TIMESTAMP和ON UPDATE,需顯示指定默認值爲timestamp類型的字段
explicit_defaults_for_timestamp=true

init_connect="set collation_connection=utf8mb4_bin"

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

5.打開C:\Windows\System32 目錄,以管理員運行cmd.exe,執行D:\software\Mysql\mysql-5.5.62-winx64\bin\mysqld install(以自己解壓目錄爲準),安裝,MySQL服務;

6.服務安裝成功,啓動服務:net start MySQL(停止服務爲:net stop MySQL);

7.將bin目錄添加到path以方便使用命令行;

8.MySQL安裝成功!!!

 

後續自己配置密碼和開啓允許遠程訪問等

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章