1. 程式人生 > >windows mysql5.7.24壓縮版安裝

windows mysql5.7.24壓縮版安裝

  • 裡面沒有my.ini檔案,在根目錄建立my.ini檔案,內容如下:
[client]
	port=3306
	default-character-set=utf8
	[mysqld]
	character-set-server=utf8 
	#collation-server=utf8_unicode_ci
	basedir="D:/software/mysql-5.7.24-winx64"
	datadir="D:/software/mysql-5.7.24-winx64/data"

  • 初始化mysql資料庫
    cmd執行:
mysqld --initialize-insecure --user=mysql

可能的異常:

2018-11-08T03:14:48.030809Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is
		 deprecated. Please use --explicit_defaults_for_timestamp server option (see doc
		umentation for more details).
		2018-11-08T03:14:48.032810Z 0 [ERROR] --initialize specified but the data direct
		ory has files in it. Aborting.

換成:

 mysqld --initialize-insecure --user=mysql --explicit_defaults_for_timestamp=true
  • 安裝mysql服務
mysqld install

執行後會看到服務裡有mysql,就成功了。

  • 其他命令
 刪除服務
  sc delete mysql