mysql綠色版安裝

來源:互聯網
上載者:User

標籤:

    網上的很多教程比較舊了,完全按照已經安裝不成功了,現在將自己剛配置成功的步驟整理如下:

一,下載mysql

    在官方網站www.mysql.com去下載,按照自己的電腦系統下載相應版本,我下載的是這個http://dev.mysql.com/downloads/utilities/,我下載的是綠色版本的  

 

二,設定檔

    解壓縮所下載的檔案後,在檔案目錄下複製my-default檔案一份,並改名為my,

    接下來就要修改my.ini的內容了。

    複製以下代碼到my.ini內,或者對比my.ini裡面的預設代碼,自己添加紅色部分。

# For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html# *** DO NOT EDIT THIS FILE. It‘s a template which will be copied to the# *** default location during install, and will be replaced if you# *** upgrade to a newer version of MySQL.[mysqld]# Remove leading # and set to the amount of RAM for the most important data# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.# innodb_buffer_pool_size = 128M# Remove leading # to turn on a very important data integrity option: logging# changes to the binary log between backups.# log_bin# These are commonly set, remove the # and set as required.# basedir = .....basedir =C:\program\mysql-5.6.25-winx64# datadir = .....datadir =C:\program\mysql-5.6.25-winx64\data# port = .....# server_id = .....# Remove leading # to set options mainly useful for reporting servers.# The server defaults are faster for transactions and fast SELECTs.# Adjust sizes as needed, experiment to find the optimal values.# join_buffer_size = 128M# sort_buffer_size = 2M# read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES #服務端的編碼方式character-set-server=utf8[client]#用戶端編碼方式,最好和服務端儲存一致loose-default-character-set = utf8[WinMySQLadmin]  Server = "C:\program\mysql-5.6.25-winx64\bin\mysqld.exe"

    注意將紅色部分的檔案路徑改成自己所解壓出來的mysql的檔案路徑。

 

三,安裝mysql服務

    開始——運行——cmd,右鍵以管理員方式登入命令列視窗,用cd C:\program\mysql-5.6.25-winx64\bin切換到自己對應的bin檔案夾下。執行mysqld -install,提示服務安裝成功!運行services.msc,此時會有一個MySQL的服務了,啟動它。

    如果發生服務無法啟動等其他情況,就需要檢驗my.ini和mysql安裝包是否正確,直到沒什麼問題,就可以進行下一步了。

 

四,登入mysql

    MySQL的預設使用者名是root,密碼為空白。

     開始——運行——cmd,右鍵以管理員方式登入命令列視窗,用cd C:\program\mysql-5.6.25-winx64\bin切換到自己對應的bin檔案夾下。

    執行“mysql -u root -p”,提示輸入密碼,由於第一次運行,密碼為空白可以直接斷行符號。

    

    出現如示welcome頁面,即表示登入mysql成功。

 

五,修改密碼

    輸入exit退出登入。

    執行mysqladmin -uroot -p password <新密碼> ,將<新密碼>替換為你的自訂密碼,然後按斷行符號。這時會提示輸入密碼,其實是指的原密碼,原密碼因為是空,所以這裡再斷行符號即可完成設定。

 

六,其他動作

    到此,mysql的綠色版安裝就完成了,有關mysql的其他動作,比如還原,備份,查看等等其他的操作可以參看mysql的其他相關資料。

mysql綠色版安裝

聯繫我們

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