Mysql解壓縮版下載安裝過程
1、進入https://www.mysql.com/downloads/官網進行mysql的下載
找到downloads首頁最下方MySQL Community Edition(GPL)進入下載,下載MySQL Community Server (GPL),我現在的最高版本為(mysql-5.7.21-winx64.zip)。
2、解壓縮
可以解壓縮到自己的文件夾,我的解壓縮目錄為:D:\programs\mysql-5.6.38-winx64
3、修改配置文件
進入C:\Program Files\MySQL\MySQL Server 5.6的目錄下,將my-default.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 = D:\programs\mysql-5.6.38-winx64
datadir = D:\programs\mysql-5.6.38-winx64\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
注意:basedir=你自己的mysql安裝路徑;
datadir=mysql所在目錄\data;
參考:http://blog.csdn.net/JLongSL/article/details/56484762
https://blog.csdn.net/wengengeng/article/details/52013650
這個鏈接也是超級詳細了,看人家的文件設置,可以說很全面了。

4、配置環境變量Path
右鍵我的電腦 -> 屬性 -> 高級系統設置 -> 環境變量 ->從系統變量中找到Path
添加mysql目錄下的bin所在路徑到Path的末端(不要覆蓋Path原值): ;D:\Development\mysql\mysql-5.7.17-winx64\mysql-5.7.17-winx64\bin 也可以動態獲取:

5、以管理員權限打開cmd
單擊開始,搜索cmd
6、在cmd中進入mysql的bin目錄
輸入:cd D:\programs\mysql-5.6.38-winx64\bin
接着輸入:mysqld -install看到安裝成功以后:

關閉服務:

第一次進入mysql時,輸入mysql -u root -p,回車,不用輸入密碼,直接回車。
修改密碼:
輸入 update mysql.user set password=PASSword('123456') where user='root';回車,執行flush privileges;通過select user();查看已經修改成功(我失敗了)。退出,重新登錄,此時輸入你的密碼即可(這里設定的123456)。
使用命令show global variables like 'port';查看端口號 3306
運行修改密碼你可能會發現報錯:
執行后報錯 ERROR 1054(42S22) Unknown column 'password' in ‘field list’
錯誤的原因是 5.7版本下的mysql數據庫下已經沒有password這個字段了,password字段改成了authentication_string
所以請使用一下命令:
update mysql.user set authentication_string=password('*******') where user='*******'; #修改密碼成功
https://www.cnblogs.com/wangbaobao/p/7087032.html
更細致的在這里:http://blog.csdn.net/JLongSL/article/details/56484762
亂碼
由於 我的配置文件設置不全,出現亂碼后:
mysql -u root -p進入mysql命令行輸入:show variables like "%char%";查看mysql安裝路徑
如下:

通過設置字符集后重啟服務即可消除亂碼:
設置字符集:


以上為MySql的安裝過程。
這里有個非常詳細的.msi安裝過程:http://blog.csdn.net/hisense20112784/article/details/72909701
服務無法啟動:
https://blog.csdn.net/liyangyang0528/article/details/54233632
刪除服務
mysql以zip安裝,解決the service already exists
https://www.cnblogs.com/dichters/p/5929209.html
mysql服務重啟和關閉
https://blog.csdn.net/u012385190/article/details/51638059
Mysql net start mysql啟動,提示發生系統錯誤 5 拒絕訪問 解決之道
https://blog.csdn.net/htyurencaotang/article/details/8305828
