Windows安裝MySql


成功結果

安裝

官網-Community --> MySql Community Server --> 壓縮包

 

 

下載完成,解壓后。

配置環境變量,這里的是win10系統。win+r ,搜索 sysdm.cpl (sysdm難記?System Data Management ,cpl難記?Control Panel Item  ,windows可執行文件)

 

 在mysql目錄新建配置文件,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:\mysql-server
# datadir = D:\mysql-server\data
# port = .....
# server_id = .....
#設置服務器字符集為utf8
character_set_server=utf8
collation-server=utf8_general_ci
#設置mysql的安裝目錄
basedir = D:\mysql-server
#設置mysql的數據文件存放目錄
datadir = D:\mysql-server\data
#設置mysql服務所綁定的端口
port = 3306
#設置mysql允許的最大連接數
max_connections=15
# 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 
[client]  
#設置客戶端字符集
default-character-set=utf8
[WinMySQLadmin]
Server = D:\mysql-server\bin\mysqld.exe            #這里路徑 看自己放的位置
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

上面Server路徑注意一下。

 

 

管理員身份打開命令行工具 cmd ,安裝 mysqld -install

創建默認數據庫  mysqld--initialize-insecure --user=mysql ,等待一會兒。發現 myql 下多了 data 文件夾

 

開服務 net start mysql

登陸~ 這里默認密碼為空

 

 

看看官網安裝教程?https://dev.mysql.com/doc/refman/8.0/en/windows-install-archive.html

 

圖形化管理mysql,使用Navicat。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM