![]()
mysql给root开启远程访问权限
mysql给root开启远程访问权限
[root@web01 ~]#mysql -uroot -pBgx123.com
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| wordpress |
+--------------------+
5 rows in set (0.00 sec)
mysql> use mysql;
Reading table information for completion of table and column names
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Bgx123.com';
Query OK, 0 rows affected, 1 warning (0.00 sec)
- 从mysql数据库的grant表中重新加载权限数据
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> select User,authentication_string,Host from user;
+---------------+-------------------------------------------+-----------+
| User | authentication_string | Host |
+---------------+-------------------------------------------+-----------+
| root | *4927A5B79C852EA2CE585A7679C5C26DF683F18C | localhost |
| mysql.session | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | localhost |
| mysql.sys | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | localhost |
| root | *4927A5B79C852EA2CE585A7679C5C26DF683F18C | % |
+---------------+-------------------------------------------+-----------+
4 rows in set (0.00 sec)
mysql>