【Navicat 实现 mysql 的远程毗连】
提示:文章写完后,目录可以自动生成,怎样生成可参考右边的帮助文档一、首次登录
进入 mysql 数据库:
# mysql -uroot -p
检察 mysql 的默认的数据库:
https://i-blog.csdnimg.cn/direct/6d850e67cb774adaa54abfb2c707b597.png
二、设置远程登录
1、确认网络
https://i-blog.csdnimg.cn/direct/693aa9397fec4223a2069d635136e3d1.png
https://i-blog.csdnimg.cn/direct/4c9fa1f2a3e945bbb61c739b6224538e.pnghttps://i-blog.csdnimg.cn/direct/88ebacf7b8c0473eaf2b6ec121e48ca7.png
2、关闭防火墙或开放端口
https://i-blog.csdnimg.cn/direct/953f04dfe2154ab1b0aa32b25b3169ff.pnghttps://i-blog.csdnimg.cn/direct/93db5f1283a9445ab0c0aab8048d6bdf.png
https://i-blog.csdnimg.cn/direct/2e9a2c2df7f44009a783850f3bed72f4.png
3、Linux 下修改配置
在 Linux 系统 MySQL 下测试
进入 mysql 数据库:
# mysql -uroot -hlocalhost -p
Enter password:
Welcome to the MySQL monitor.Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 8.0.26 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
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>
显示数据库:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.01 sec)
mysql>
使用数据库:
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> select host,user from user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+------------------+
4 rows in set (0.00 sec)
mysql> update user set host = '%' where user='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1Changed: 1Warnings: 0
mysql>select host,user from user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| % | root |
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
+-----------+------------------+
4 rows in set (0.00 sec)
刷新权限:
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
报错解决方法:
mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_passwordBY 'DDD_ddd123';
Query OK, 0 rows affected (0.01 sec)
Navicat 毗连乐成:
https://i-blog.csdnimg.cn/direct/ed52c3ddc1aa41b7b3b24f65809e2f02.png进入 Navicat 界面:
https://i-blog.csdnimg.cn/direct/68be7493863842b4ae0239d73a3eef37.png
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]