[Mysql] 2.Mysql 5.7 Install (Windows)

tolilong發表於2016-09-07

http://dev.mysql.com/downloads/mysql/    下載地址 , 在下拉框中選擇相應的版本

windows 下直接雙擊下載檔案安裝

直接上圖吧
































 

 

本地連線測試一下 .

E:\mysql\bin>mysql -h 172.16.20.31 -u root -p

Enter password: *****

ERROR 1130 (HY000): Host '192.168.111.112' is not allowed to connect to this MySQL server

 

server 短執行如下動作:

Enter password: *****

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 14

Server version: 5.7.14-log 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.

 

mysql> use mysql

Database changed

mysql> select user,host from user;

+-----------+-----------+

| user      | host      |

+-----------+-----------+

| mysql.sys | localhost |

| root      | localhost |

+-----------+-----------+

2 rows in set (0.00 sec)

root 使用者只允許在 127.0.0.1 localhost 上進行連線,而不允許使用本機在區域網中的 ip 進行連線

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.111.112' IDENTIFIED BY 'mysql' WITH GRANT OPTION;

Query OK, 0 rows affected, 1 warning (0.00 sec)

 

mysql> flush privileges;

Query OK, 0 rows affected (0.02 sec)

 

mysql>

 

重新連線生效 ,

E:\mysql\bin>mysql -h 172.16.20.31 -u root -pmysql

mysql: [Warning] Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 15

Server version: 5.7.14-log 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.

 

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| sakila             |

| sys                |

| world              |

+--------------------+

6 rows in set (0.01 sec)

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-2124675/,如需轉載,請註明出處,否則將追究法律責任。

相關文章