詳細(xì)說明MySql 5.7.17免安裝設(shè)置圖文說明教程的示例代碼
發(fā)表時間:2023-09-10 來源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]這篇文章給大家詳細(xì)介紹了MySql 5.7.17免安裝配置教程,首先大家需要先下載mysql 5.7.17 的安裝包,然后解壓,具體配置過程大家通過本文一起學(xué)習(xí)吧1、下載mysql-5.7.17-winx64.zip安裝包2、解壓安裝包。D:\DevelopTool\mysql-5.7.17-wi...
這篇文章給大家詳細(xì)介紹了
MySql 5.7.17免安裝配置教程,首先大家需要先下載mysql 5.7.17 的安裝包,然后解壓,具體配置過程大家通過本文一起學(xué)習(xí)吧
1、下載mysql-5.7.17-winx64.zip安裝包
2、解壓安裝包。
D:\DevelopTool\mysql-5.7.17-winx64 #解壓目錄
3、在解壓目錄下創(chuàng)建一個名為data的文件夾,用來存放數(shù)據(jù)
D:\DevelopTool\mysql-5.7.17-winx64\data
4、配置啟動文件
把 D:\DevelopTool\mysql-5.7.17-winx64\my-default.ini 文件copy一份,重新命名為 my.ini ,修改里面的參數(shù),如下:
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/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 = .....
# datadir = .....
# port = .....
# server_id = .....
#########################
# basedir 為安裝文件解壓后的目錄 | basedir和datadir 可以使用相對路徑
# basedir=./..
basedir=D:\\DevelopTool\\mysql-5.7.11-winx64
# datadir 為用來存放數(shù)據(jù)的目錄
# datadir=./../data
datadir=D:\\DevelopTool\\mysql-5.7.11-winx64\\data
# port 為端口號
port=3306
# mar_connections為最大連接數(shù)
max_connections=20
character_set_server=utf8
# 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
explicit_defaults_for_timestamp=true
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
5、初始化數(shù)據(jù)目錄
mysqld --defaults-file="D:\DevelopTool\mysql-5.7.17-winx64\my.ini" --initialize-insecure
它會初始化 data 目錄,在執(zhí)行此命令前請先把data目錄下的所有文件先刪除,否則會失敗
可以選擇用 --initialize-insecure 或者 --initialize 來初始化,--initialize-insecure 初始化root密碼為空,如果用 --initialize來初始化,會產(chǎn)生一個隨機(jī)密碼
執(zhí)行成功后,在data目錄下會生成mysql,perofrmance_schema,sys等目錄文件
6、安裝和啟動mysql服務(wù)
#安裝服務(wù)
mysqld -install
#啟動服務(wù)
net start mysql
#進(jìn)入mysql
mysql -u root -p
#移除mysql
mysqld -remove
以上就是詳細(xì)介紹MySql 5.7.17免安裝配置教程的示例代碼的詳細(xì)內(nèi)容,更多請關(guān)注php中文網(wǎng)其它相關(guān)文章!
學(xué)習(xí)教程快速掌握從入門到精通的SQL知識。