win7 64位下如何安裝配置mysql-5.7.4-m14-winx64

win7 64位下如何安裝配置mysql-5.7.4-m14-winx64
1. mysql-5.7.4-m14-winx64.zip下載

官方網站下載地址:http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.17-winx64.ziphtml

二、解壓到D:\mysql.(路徑本身指定)
三、在D:\mysql\mysql-5.7.4-m14-winx64下新建my.ini配置文件

內容以下:mysql

####################配置文件開始###################
# 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.
[client]
default-character-set=utf8

[mysqld]
port=3306
basedir ="D:/mysql/mysql-5.7.4-m14-winx64/"
datadir ="D:/mysql/mysql-5.7.4-m14-winx64/data/"
tmpdir ="D:/mysql/mysql-5.7.4-m14-winx64/data/"
socket ="D:/mysql/mysql-5.7.4-m14-winx64/data/mysql.sock"
log-error="D:/mysql/mysql-5.7.4-m14-winx64/data/mysql_error.log"sql

#server_id = 2
#skip-lockingwindows

max_connections=100
table_open_cache=256
query_cache_size=1Msocket

tmp_table_size=32M
thread_cache_size=8網站

innodb_data_home_dir="D:/mysql/mysql-5.7.4-m14-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
####################配置文件結束###################ui


重點是如下配置,其中datadir的目錄名稱必須是:D:/mysql/mysql-5.7.4-m14-winx64/data/。命令行

四、在windows系統環境變量path,加入以下內容
D:\mysql\mysql-5.7.4-m14-winx64\bin;(注意加分號)
server

五、將mysql註冊爲windows系統服務
具體操做是在命令行中執行如下命令(須要以管理員身份運行命令行):htm

mysqld install MySQL --defaults-file="D:\mysql\mysql-5.7.4-m14-winx64\my.ini"

 

移除服務命令爲:mysqld remove

六、第5步成功後,打開系統服務管理
能夠看到mysql系統服務:(此處須要注意)

須要在服務的登錄屬性裏配置管理員用戶登錄(不配置從服務管理裏啓動報1035錯誤,在命令行啓動報啓動失敗),以下:

在命令行啓動mysql命令爲: net start mysql


關閉mysql命令爲:net stop mysql

七、修改root的密碼爲123456
命令行執行:mysql –uroot
mysql>show databases;
mysql>use mysql;
mysql> UPDATE user SET password=PASSWORD("123456") WHERE user='root';
  mysql> FLUSH PRIVILEGES;
mysql> QUIT

八、此時能夠在本機上客戶端鏈接了(本人用的是SQLyog)

九、遠程登錄配置容許root用戶在任何地方進行遠程登陸,並具備全部庫任何操做權限,具體操做以下: 1)在本機先使用root用戶登陸mysql:命令行執行:mysql -u root -p 輸入密碼(第7步中設置的密碼):1234562)進行受權操做:mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;重載受權表:mysql>FLUSH PRIVILEGES;退出mysql:quit

相關文章
相關標籤/搜索