本文實(shí)例為大家分享了mysql 5.7.13 winx64安裝配置方法圖文教程,供大家參考,具體內(nèi)容如下
下載
地址:http://dev.mysql.com/downloads/file/?id=463242
安裝
1、解壓下載好的mysql-5.7.13-winx64.zip到你需要安轉(zhuǎn)的目錄(eg:D:\mysql);
2、配置解壓目錄下的my_default.ini中命名為my.ini
作相關(guān)的配置如下:
1
2
3
4
5
|
# These are commonly set, remove the # and set as required. basedir = D:\mysql5.7(mysql安裝目錄) datadir = D:\mysql5.7\data(mysq中數(shù)據(jù)的保存目錄,自己定) port = 3306(mysq的端口號(hào)) # server_id = ..... |
3、添加環(huán)境變量
將D:\mysql5.7\bin添加到環(huán)境變量之中;
eg:......;D:\mysql5.7\bin
4、初始化
進(jìn)入MySQL的bin文件夾
mysqld –install
mysqld –initialize –console (有一個(gè) root@localhost: 后面有一連串的字母數(shù)字符號(hào), 這是 MySQL 為你自動(dòng)生成的隨機(jī)密碼,一定要記下來(lái), 一會(huì)我們登陸 MySQL 數(shù)據(jù)庫(kù)的時(shí)候要用)。
PS:使用-initialize生成隨機(jī)密碼,使用-initialize-insecure生成空密碼,初始化后data文件夾會(huì)自動(dòng)生成,不用自己新建哦。
5、啟動(dòng)mysql
net start mysql
6、進(jìn)入msyql并設(shè)置密碼
1
2
3
4
5
6
7
8
9
10
|
D:\mysql5.7\bin>mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.13 MySQL Community Server (GPL) Copyright (c) 2000, 2016, Oracle and /or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and /or its affiliates. Other names may be trademarks of their respective |
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
1
2
3
4
|
mysql> set password=password( '你自己的密碼' ); Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> |
連接到遠(yuǎn)程的mysql(兩臺(tái)win7局域網(wǎng)之間的連接mysql)
連接中的錯(cuò)誤:
1、錯(cuò)誤描述:設(shè)置root的遠(yuǎn)程權(quán)限時(shí):ERROR 1062 (23000): Duplicate entry ‘%-root' for key ‘PRIMARY'(最好不用這個(gè),使用使用下面的的方法授權(quán))。
解決辦法:已經(jīng)設(shè)置成功了。
2、mysql中的授權(quán):
1
2
|
mysql> GRANT ALL PRIVILEGES ON . TO ‘root '@' % ' IDENTIFIED BY ‘密碼' WITH GRANT OPTION; mysql> flush privileges; |
3、關(guān)閉防火墻(同時(shí)注意作為mysql載體的win7的ip地址的正確性局域網(wǎng)ip)
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持服務(wù)器之家。