mysql57免安裝版配置


1,下載mysql5.7壓縮文件【具體到官網下載就行了】

2,解壓並把mysql5.7放到c盤根目錄下

3,進入mysql5.7主目錄修改my-default.ini 重命名為:my.ini [如果沒有的話就自己創建一個my.ini]

4,my.ini配置:

[client]
port=3306
default-character-set=utf8


[mysql]
default-character-set=utf8
[mysqld]
basedir="C:\mysql57"
datadir="C:\mysql57\data"
explicit_defaults_for_timestamp=true
port=3306

 

server_id=1
character-set-server=utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

log-output=FILE
general-log=0
general_log_file="123-PC.log"
slow-query-log=1
slow_query_log_file="123-PC-slow.log"
long_query_time=10


max_connections=151
query_cache_size=0
table_open_cache=2000
tmp_table_size=25M


thread_cache_size=10
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=42M
key_buffer_size=8M
read_buffer_size=64K
read_rnd_buffer_size=256K
sort_buffer_size=256K


innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=8M
innodb_log_file_size=48M
innodb_thread_concurrency=9
innodb_autoextend_increment=64
innodb_buffer_pool_instances=8
innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_open_files=300
innodb_stats_on_metadata=0
innodb_file_per_table=1
innodb_checksum_algorithm=0


back_log=80
flush_time=0
join_buffer_size=256K
max_allowed_packet=4M
max_connect_errors=100
open_files_limit=4161
query_cache_type=0
sort_buffer_size=256K
table_definition_cache=1400
binlog_row_event_max_size=8K


sync_master_info=10000
sync_relay_log=10000
sync_relay_log_info=10000


[WinMySQLadmin]
Server=C:\mysql57\bin\mysqld.exe

 

 

【注意:】

以上配置主要有幾點需要改,如下:

 

Server=C:\mysql57\bin\mysqld.exe

basedir="C:\mysql57"
datadir="C:\mysql57\data"
explicit_defaults_for_timestamp=true

 

5,注冊mysql服務

使用管理員身份打開cmd,進入mysql目錄下的bin

1)注冊服務:

mysqld install

2)初始化配置

mysqld --initialize-insecure

3)開啟服務

net start mysql

4)設置root用戶密碼:

mysqladmin -u root -p password【注意第一步不輸入密碼,直接enter,第二步會提示你輸入新密碼以及驗證密碼】

5)mysql -u root -p【輸入密碼開啟你的mysql之旅吧】

 

忘了,還有一件事,配置一下mysql\bin下的環境變量【總不能每次都進mysql的bin目錄執行吧】

祝你安裝順利!!

 


免責聲明!

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



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