MySql绿色版安装过程记录
作為程序猿,要多動手,周末趁著有空且筆記本剛剛裝了系統,所以就配置了下綠色版的MySQL。
多動手,多動手,多動手。
多總結,多總結,多總結。
以下為正文:
一、下載MySQL綠色版:
1.這個地址:http://dx2.xiazaiba.com/Soft/M/MySQL_5.6.27_XiaZaiBa.zip
?
2.或者去官網也可以的。
?
二、下載下來后,解壓(安裝)后在所對應的目錄如下圖所示:
那么接下來步驟如下:
1.將"my-default.ini"修改為"my.ini".
2.將如下代碼復制進去:注意修改basedir datadir 和 Server
# 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. #mysql根目錄 basedir ="C:\Soft\MySql" #數據文件存放目錄 datadir ="C:\Soft\MySql\data" # port = ..... 端口,默認3306 # 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:\Soft\MySql\bin\mysqld.exe"?
三、"注冊服務"
打開控制臺依次輸入如下指令:
cd C:\Soft\MySql\bin mysqld --install MySQL --defaults-file="C:\Soft\MySql\my.ini" net start MySQL1.第一條語句表示跳轉到MySQL解壓后的目錄中的bin文件夾。
2.第二條語句是表示通過我們配置的my.ini 注冊服務。
3.表示啟動服務。此步完成后如果提示OK,那么啟動成功。
注:如果缺少第一步很可能出現一些錯誤,包括但不限于:系統錯誤或者系統找不到指定文件。
PS:附件幾句可能會用到的命令,如果安裝出錯,那么卸載MySQL的指令如下
mysqld --remove MySQL?
四、其他瑣事
1.修改密碼
mysqladmin -u {userName} -p password {password}解釋:{userName}為你的數據庫密碼,默認用戶名為 root,{password}為你的密碼,默認密碼為空。如果為空什么也不需要輸入直接enter。
接下來系統會再次提示你輸入舊密碼,然后輸入一次新密碼,再確認輸入一次:
Enter password: New password: ****** Confirm new password: ******2.開啟遠程連接
update user set host = '%' where user = 'root'; select host, user from user;flush privileges;a.第一步是更新
b.第二句是查詢。
c.第三句是刷新使MySQL立刻起效。
如果出現了如圖信息表示成功。
?或者使用
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;?說明:myuser為用戶名,mypassword為密碼
?
3.修改數據庫編碼值?
show variables like '%char%'可以查看編碼
如果覺得那個編碼不符合你要求,可以修改:
SET character_set_XXXX =utf8下圖是我的編碼值設定,僅供參考:
4.查看當前數據庫信息
show variables like '%version%?
PS:2015-11-14 重啟后出現如下問題:
Access denied for user 'root'@'localhost' (using password: YES)
沒搞定此問題。。。。結果重裝試試!
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的MySql绿色版安装过程记录的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: windows自带的压缩,解压缩命令
- 下一篇: NodeJS 安装