windows 安裝 mysql5.7.17

來源:互聯網
上載者:User

標籤:啟動mysql   選項   pass   unity   get   head   board   安裝   my.ini   

下載mysql
  • 進入官網:https://www.mysql.com/
  • 單擊【Downloads】選項卡
  • 最下面有個【 MySQL Community Edition  (GPL)】,單擊【Community (GPL) Downloads ?】
  • 單擊【MySQL Community Server (GPL)】下的【DOWNLOAD】
  • 在彈出的頁面上下載【Windows (x86, 64-bit), ZIP Archive】
安裝mysql 壓縮包相當於免安裝檔案,要想使用它,需要配置正確,並通過服務來啟動資料庫服務。1.把壓縮包解壓到你喜歡的位置本樣本解壓到:D:\mysql-5.7.13-winx64,檔案夾下   2.建立my.ini檔案,內容如下: [plain] view plain copy  
  1. [mysqld]  
  2. port=3306  
  3. basedir  ="D:\\mysql-5.7.13-winx64\\"  
  4. datadir  ="F:\\mysqlData\\"  
  5.   
  6.   
  7. max_allowed_packet = 32M  
 注意,basedir和datadir是必須要配置的,basedir就是你解壓的目錄。官方文檔上說,如果你喜歡用斜杠,則要用雙斜杠,反斜線的話就不用這樣。即:D:\\mysql-5.7.13-winx64\\ 或:D:/mysql-5.7.13-winx64/由於本人喜歡把資料庫的資料檔案獨立出來,所以就把datadir配置到其它地方,方便管理。另外,建立該目錄。 3.配置環境變數
  • 添加一個名叫 MYSQL_HOME 的變數。
  • 修改Path變數,在末尾添加 %MYSQL_HOME%\bin 
4.安裝mysql服務
  • 以管理員身份運行cmd,進入mysql的bin目錄。
  • 初始化資料庫檔案
[plain] view plain copy  
  1. mysqld  --initialize  
 初始化成功後,會在datadir目錄下產生一些檔案,其中,xxx.err檔案裡說明了root賬戶的臨時密碼。那行大概長這樣: [plain] view plain copy  
  1. 2016-07-24T05:19:20.152135Z 1 [Note] A temporary password is generated for [email protected]: bL2uuwuf0H(X  

即密碼是:bL2uuwuf0H(X 
  • 註冊mysql服務
[html] view plain copy  
  1. mysqld -install MySQL  
  • 啟動mysql服務
[plain] view plain copy  
  1. net start MySQL  

 

使用 3307 登入

mysql -uroot -h127.0.0.1 -P3307 -p

修改密碼

ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘new_password‘; 

 

windows 安裝 mysql5.7.17

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.