win7 64位下如何安裝配置mysql-5.7.5-m15-winx64
距離上次安裝MySQL已經(jīng)過去好久了。步驟這些,有可能會(huì)忘記。簡單記錄一下吧。(參考了一些網(wǎng)絡(luò)上的博客。)
1.mysql-5.7.5-m15-winx64.zip下載
官方網(wǎng)站下載地址:http://cdn.mysql.com/Downloads/MySQL-5.7/mysql-5.7.5-m15-winx64.zip
2.解壓到D:\MySqlDataBase
3.在D:\MySqlDataBase\mysql-5.7.5-m15-winx64下新建my.ini配置文件
內(nèi)容如下:
####################配置文件開始###################
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/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.
[client]
default-character-set=utf8
[mysqld]
port=3306
basedir ="D:\MySqlDataBase\mysql-5.7.5-m15-winx64/"
datadir ="D:\MySqlDataBase\mysql-5.7.5-m15-winx64/data/"
tmpdir ="D:\MySqlDataBase\mysql-5.7.5-m15-winx64/data/"
socket ="D:\MySqlDataBase\mysql-5.7.5-m15-winx64/data/mysql.sock"
log-error="D:\MySqlDataBase\mysql-5.7.5-m15-winx64/data/mysql_error.log"
#server_id = 2
#skip-locking
max_connections=100
table_open_cache=256
query_cache_size=1M
tmp_table_size=32M
thread_cache_size=8
innodb_data_home_dir="D:\MySqlDataBase\mysql-5.7.5-m15-winx64/data/"
innodb_flush_log_at_trx_commit =1
innodb_log_buffer_size=128M
innodb_buffer_pool_size=128M
innodb_log_file_size=10M
innodb_thread_concurrency=16
innodb-autoextend-increment=1000
join_buffer_size = 128M
sort_buffer_size = 32M
read_rnd_buffer_size = 32M
max_allowed_packet = 32M
explicit_defaults_for_timestamp=true
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
####################配置文件結(jié)束###################
重點(diǎn)是以下配置,其中datadir的目錄名稱必須是:D:\MySqlDataBase\mysql-5.7.5-m15-winx64/data/。
4.在windows系統(tǒng)環(huán)境變量path,加入如下內(nèi)容
D:\mysql\mysql-5.7.5-m15-winx64\bin;(注意加分號(hào))
5、將mysql注冊(cè)為windows系統(tǒng)服務(wù)
具體操作是在命令行中執(zhí)行以下命令(需要以管理員身份運(yùn)行命令行):
需要切換到bin目錄,否則,會(huì)將服務(wù)目錄指定為C:\Program Files\MySQL\MySQL Server 5.7\mysqld
增加服務(wù)命令:mysqld install MySQL --defaults-file="D:\mysql\mysql-5.7.5-m15-winx64\my.ini"
移除服務(wù)命令為:mysqld remove
6.第5步成功后,打開系統(tǒng)服務(wù)管理
可以看到mysql系統(tǒng)服務(wù)
在命令行啟動(dòng)mysql命令為:net start mysql
關(guān)閉mysql命令為:net stop mysql
7.修改root的密碼為wenthink
命令行執(zhí)行:mysql –uroot
mysql>show databases;
mysql>use mysql;
mysql> UPDATE user SET password=PASSWORD('wenthink') WHERE user='root';
mysql> FLUSH PRIVILEGES;
mysql> QUIT
遠(yuǎn)程登陸配置
允許root用戶在任何地方進(jìn)行遠(yuǎn)程登錄,并具有所有庫任何操作權(quán)限,具體操作如下:
1)在本機(jī)先使用root用戶登錄mysql:
命令行執(zhí)行:mysql -u root -p
輸入密碼(第7步中設(shè)置的密碼):wenthink
2)進(jìn)行授權(quán)操作:
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;
重載授權(quán)表:
mysql>FLUSH PRIVILEGES;
退出mysql:quit
以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
您可能感興趣的文章:- mysql 5.7.17 winx64.zip安裝配置方法圖文教程
- mysql 5.7.11 winx64.zip安裝配置方法圖文教程
- Mysql5.7.17 winx64.zip解壓縮版安裝配置圖文教程