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