windows系統下安裝最新mysql 5.7.13解壓版

最近由於須要測試mysql的多種主從配置方案,因此要安裝多個mysql。爲了更好的應用機器,乾脆就在一臺windows機器上安裝了多個mysql,用不一樣的端口號區別開。那麼,最好的選擇天然就是安裝多個mysql解壓版,而不是那種msi安裝版,能夠達到綠色版的用後即焚效果。html

系統環境:win 7,32位系統
mysql版本:5.7.13社區版
mysql下載地址:http://dev.mysql.com/downloads/mysql/,我下載的是大小爲296.5M的
Windows (x86, 32-bit), ZIP Archive
mysql官方安裝文檔:http://dev.mysql.com/doc/refman/5.7/en/windows-install-archive.htmlmysql

下面開始安裝和配置步驟:
1.將下載下來的文件mysql-5.7.13-win32.zip解壓至一個分區或者目錄中,例如c盤。解壓完,會發如今mysql-5.7.13-win32目錄下有一個my-default.ini文件。將此文件放到你想放置的目錄下,並更名爲my.ini,而後編輯之,打開basedir,datadir,port等項,按以下配置:sql

basedir = F:\\mysql-5.7.13-win32
datadir = F:\mysql-5.7.13-win32\\data
port = 3306

2.在windows命令行下進入mysql的解壓目錄,而後執行windows

F:\mysql-5.7.13-win32\bin>mysqld --defaults-file=F:\mysql-5.7.13-win32\my.ini --initialize

按照官方安裝文檔的說明,在初始化完,會給出一個root帳號的臨時隨機密碼,下面這段話摘錄自官方文檔:安全

With --initialize but not --initialize-insecure, the server generates a random password, marks it as expired, and writes a message displaying the password:

[Warning] A temporary password is generated for root@localhost:
iTag*AfrH5ej

但是我運行完這個命令以後,什麼提示也沒有出現啊!bash

沒管那麼多,我開始接着啓動mysqldom

F:\mysql-5.7.13-win32\bin>mysqld --console

在命令行顯示瞭如下信息:socket

2016-07-25T11:09:58.866483Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-07-25T11:09:58.866483Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2016-07-25T11:09:58.866483Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2016-07-25T11:09:58.866483Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2016-07-25T11:09:58.867483Z 0 [Note] mysqld (mysqld 5.7.13) starting as process 9112 ...
2016-07-25T11:09:58.878483Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2016-07-25T11:09:58.879483Z 0 [Note] InnoDB: Uses event mutexes
2016-07-25T11:09:58.880484Z 0 [Note] InnoDB: Memory barrier is not used
2016-07-25T11:09:58.881484Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-07-25T11:09:58.883484Z 0 [Note] InnoDB: Number of pools: 1
2016-07-25T11:09:58.902485Z 0 [Note] InnoDB: Not using CPU crc32 instructions
2016-07-25T11:09:58.916486Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2016-07-25T11:09:58.936487Z 0 [Note] InnoDB: Completed initialization of bufferpool
2016-07-25T11:09:59.032492Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-07-25T11:09:59.259505Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-07-25T11:09:59.260505Z 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 12MB. Physically writing the file full; Please wait ...
2016-07-25T11:10:00.166557Z 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB.
2016-07-25T11:10:00.171557Z 0 [Note] InnoDB: 96 redo rollback segment(s) found.96 redo rollback segment(s) are active.
2016-07-25T11:10:00.174558Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2016-07-25T11:10:00.175558Z 0 [Note] InnoDB: Waiting for purge to start
2016-07-25T11:10:00.336567Z 0 [Note] InnoDB: 5.7.13 started; log sequence number 2524844
2016-07-25T11:10:00.338567Z 0 [Note] Plugin 'FEDERATED' is disabled.
2016-07-25T11:10:00.353568Z 0 [Note] InnoDB: Loading buffer pool(s) from F:\mysql-5.7.13-win32\data\ib_buffer_pool
2016-07-25T11:10:01.957660Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2016-07-25T11:10:01.959660Z 0 [Note] Server hostname (bind-address): '*'; port:3306
2016-07-25T11:10:01.962660Z 0 [Note] IPv6 is available.
2016-07-25T11:10:01.965660Z 0 [Note]   - '::' resolves to '::';
2016-07-25T11:10:01.969660Z 0 [Note] Server socket created on IP: '::'.
2016-07-25T11:10:06.438916Z 0 [Note] Event Scheduler: Loaded 0 events
2016-07-25T11:10:06.439916Z 0 [Note] mysqld: ready for connections.Version: '5.7.13'  socket: ''  port: 3306  MySQL Community Server (GPL)
2016-07-25T11:10:11.615212Z 0 [Note] InnoDB: Buffer pool(s) load completed at 160725 11:10:11

mysql應該是順利啓動了,而後我用mysql客戶端軟件進行登陸,問題來了,問題再一次如約而至。。。
登陸須要口令,而我卻從沒獲得一個臨時生成的口令!這官方安裝文檔也太坑爹了吧。ide

3.這下又陷入束手無策了,思考了一下子,我想要不就試試--initialize-insecure參數吧,畢竟insecure是不安全的意思。。。測試

因而我中止mysql,刪除了已經初始化的data目錄,執行下面的命令,從新進行初始化:

F:\mysql-5.7.13-win32\bin>mysqld --defaults-file=F:\mysql-5.7.13-win32\my.ini --initialize-insecure

和以前同樣,仍是沒有出現任何提示就運行完成了。
再次啓動mysql

F:\mysql-5.7.13-win32\bin>mysqld --console

而後我再次使用navicat客戶端軟件進行登陸,將口令設置爲空,此次成功登陸mysql!
固然,登陸後記得修改root密碼。

4.最後,解壓版安裝完,發現整個mysql已經達到了1.66G,實在是很佔用硬盤空間。 固然,接下來就能夠繼續以解壓方式安裝3307,3308,3309。。。了。

相關文章
相關標籤/搜索