windows下安裝MySQL

longer3281發表於2018-03-22
1)下載安裝檔案
2)解壓安裝檔案到指定目錄
3)配置好引數檔案;
4)初始化MySQL資料庫
mysqld --initialize datadir=D:\MySQL\mariadb-10.2.13-winx64\datadb
5)註冊服務
D:\MySQL\mariadb-10.2.13-winx64\bin\mysqld install mysqld --defaults-file=D:\MySQL\mariadb-10.2.13-winx64\datadb\my.ini 
6)啟動MySQL服務:
     a)直接在 windows服務配置裡直接啟動
     b)命令列啟動: net start mysqld (停止服務 net stop mysqld)
7)刪除服務
   需要在管理員模式下開啟cmd,執行sc delete mysqld 即可
8)附上引數檔案:
#[mysqld]
#datadir=D:/MySQL/mariadb-10.2.13-winx64/data
#[client]
#plugin-dir=D:/MySQL/mariadb-10.2.13-winx64/lib/plugin
#
[client]
#password = your_password
port = 3306
socket =  D:\\MySQL\mariadb-10.2.13-winx64\\mysql.sock
plugin-dir=D:\\MySQL\\mariadb-10.2.13-winx64\\lib\\plugin
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
basedir=D:\\MySQL\mariadb-10.2.13-winx64
datadir=D:\\MySQL\mariadb-10.2.13-winx64\\datadb
log-error=D:\\MySQL\mariadb-10.2.13-winx64\\datadb\\mysqld.log
port = 3306
socket = D:\\MySQL\mariadb-10.2.13-winx64\\mysql.sock
init_connect = 'SET NAMES utf8'
skip-external-locking
key_buffer_size = 16K
max_allowed_packet = 1M
table_open_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 240K
server-id = 168
innodb_data_file_path = ibdata1:10M:autoextend
innodb_buffer_pool_size = 400M
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 60
character_set_server=utf8
collation-server=utf8_general_ci
character_set_client=utf8
log-bin=mysql-bin
binlog_format=mixed
expire_logs_days=3
max_binlog_size=200M
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
default-character-set=utf8
character_set_connection=utf8
no-auto-rehash
[client]
default-character-set=utf8
[myisamchk]
key_buffer_size = 8M
sort_buffer_size = 8M
[mysqlhotcopy]
interactive-timeout







來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9606353/viewspace-2152093/,如需轉載,請註明出處,否則將追究法律責任。

相關文章