MySQL 5.7.9 免安裝配置

MySQL 5.7.9 免安裝配置

環境:win10 64位

mysql版本:mysql-5.7.9-winx64.zip (http://dev.mysql.com/downloads/mysql/java

首先聲明一下,5.7.9這個版本的配置方式跟以前的免安裝版配置不同。(.msi安裝版和其餘版本的能夠忽略該方法)
步驟:
1,在官網上下載了mysql-5.7.9-winx64.zip 這個文件以後, 解壓到指定目錄:F:\java\mysql\mysql-5.7.9-winx64
2,在F:\java\mysql\mysql-5.7.9-winx64 目錄建立data文件夾
3,將my.default.ini更名爲my.ini放到bin目錄,而且在my.ini目錄加入以下代碼:
basedir = F:\java\mysql\mysql-5.7.9-winx64
datadir = F:\java\mysql\mysql-5.7.9-winx64\data
port = 3306
4,配置環境變量,path=F:\java\mysql\mysql-5.7.9-winx64\bin
5,以管理員權限打開命令行,進入到F:\java\mysql\mysql-5.7.9-winx64\bin目錄,
執行: mysqld --initialize --user=mysql --console
6,先執行以上命令, 會生成庫. 注意有個臨時密碼, 要記下來.mysql

F:\java\mysql\mysql-5.7.9\bin>mysqld --initialize --user=mysql --console 2015-11-03T02:12:10.856918Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2015-11-03T02:12:10.856918Z 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. 2015-11-03T02:12:10.856918Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set. 2015-11-03T02:12:14.162565Z 0 [Warning] InnoDB: New log files created, LSN=45790 2015-11-03T02:12:14.884331Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. 2015-11-03T02:12:15.123784Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 4d177d5b-81d0-11e5-bb66-c454443dc023. 2015-11-03T02:12:15.176861Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 2015-11-03T02:12:15.189872Z 1 [Note] A temporary password is generated for root@localhost:  >GqoShvY!03e 

 

7,如本次執行的臨時密碼是: >GqoShvY!03e
8, 執行安裝服務命令: mysqld –install
9,執行啓動服務命令: net start mysql
10,到此,mysql就安裝好了。 而後執行:mysql -uroot -p
11,輸入剛纔的密碼: >GqoShvY!03e
12,執行改密碼命令:set password = password(‘password’)
13,至此,就root帳號的密碼就被你改爲password了sql

相關文章
相關標籤/搜索