標籤:
作業系統:windows 2003
mysql版本:mysql-5.6.22-winx64.zip
安裝及配置步驟:
1,解壓縮mysql;
2,建立my.ini檔案並寫入一下內容:
[client]no-beepport=3369default-character-set=utf8[mysql]default-character-set=utf8[mysqld]port=3369#mysql解壓目錄basedir=D:/mysql_test/mysql-5.6.22-winx64#mysql資料檔案所在位置datadir=D:/mysql_test/mysql-5.6.22-winx64/datacharacter-set-server=utf8default-storage-engine=INNODBsql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"# General and Slow logging.log-output=FILEgeneral-log=0general_log_file="WIN-SAN3COGQ5SE.log"slow-query-log=1#慢查詢記錄檔存放位置slow_query_log_file="D:/mysql_test/mysql-5.6.22-winx64/slow_sql_log.log"long_query_time=5log-error="WIN-SAN3COGQ5SE.err"server-id=1max_connections=151query_cache_size=512Mtable_open_cache=2000tmp_table_size=706Mthread_cache_size=16#*** MyISAM Specific optionsmyisam_max_sort_file_size=10Gmyisam_sort_buffer_size=2Gkey_buffer_size=8Mread_buffer_size=64Kread_rnd_buffer_size=256Ksort_buffer_size=32M#*** INNODB Specific options ***innodb_additional_mem_pool_size=32Minnodb_flush_log_at_trx_commit=0innodb_log_buffer_size=16Minnodb_buffer_pool_size=4Ginnodb_log_file_size=1024Minnodb_thread_concurrency=33innodb_autoextend_increment=64innodb_buffer_pool_instances=16innodb_concurrency_tickets=5000innodb_old_blocks_time=1000innodb_open_files=300innodb_stats_on_metadata=0innodb_file_per_table=1innodb_checksum_algorithm=0back_log=80flush_time=0join_buffer_size=32Mmax_allowed_packet=24Mmax_connect_errors=100open_files_limit=4161query_cache_type=1sort_buffer_size=32Mtable_definition_cache=1400binlog_row_event_max_size=8Ksync_master_info=10000sync_relay_log=10000sync_relay_log_info=10000
3,建立mysql啟動服務
cmd -> mysql/bin -> mysqld.exe -install mysql<服務名> --defaults-file="my.ini檔案所在路徑"
進入windows管理 - 服務 查看mysql服務是否建立成功,並啟動服務;
刪除mysql服務;
mysqld.exe -remove mysql<服務名>
4,測試mysql安裝是否成功;host:localhost user:root password:(空,首次安裝無密碼)
5,設定使用者
#刪除匿名使用者
#建立新使用者並限制可訪問ip;如:
使用者名稱為newuser,host為10.64.7.%,意思為,僅有來自10.64.7.%這個位址區段才能進行訪問;
#使root使用者僅能在本機使用,host為localhost,127.0.0.1,::1(這是ipv6的 127.0.0.1)並設定密碼;
6,許可權授權,原則是最小許可權授權.
MySQL解壓縮版安裝手記(windows)