MySQL 5.7.9 免安裝配置

來源:互聯網
上載者:User

標籤:

環境:win10 64位 
mysql版本:mysql-5.7.9-winx64.zip (http://dev.mysql.com/downloads/mysql/)

首先聲明一下,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,先執行以上命令, 會產生庫. 注意有個臨時密碼, 要記下來.

F:\java\mysql\mysql-5.7.9\bin>mysqld --initialize --user=mysql --console2015-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=457902015-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 [email protected]: v2toK7w,TJ_<

 

7,如本次執行的臨時密碼是:v2toK7w,TJ_< 
8, 執行安裝服務命令: mysqld –install 
9,執行啟動服務命令: net start mysql 
10,到此,mysql就安裝好了。 然後執行:mysql -uroot -p 
11,輸入剛才的密碼:v2toK7w,TJ_< 
12,執行改密碼命令:set password = password(‘password’) 
13,至此,就root帳號的密碼就被你改成password了

MySQL 5.7.9 免安裝配置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.