当前位置:网站首页>华为云服务器装数据库远程连接被拒绝
华为云服务器装数据库远程连接被拒绝
2022-06-09 03:29:00 【code_peak】
在华为云服务器上装了 MariaDB,并且为用户授予了远程连接的权限,查看用户信息如下,Host 为 % 是可以远程连接的:
MariaDB [(none)]> SELECT User, Host FROM mysql.user;
+----------+-----------+
| User | Host |
+----------+-----------+
| codepeak | % |
| root | % |
| codepeak | localhost |
| root | localhost |
+----------+-----------+
4 rows in set (0.000 sec)
用户添加后,进行了权限刷新,flush privileges; 而且还重启了数据库服务。
但使用数据库可视化工具 Navicat 连不上,然后就想到了云服务器端口是否开放。
进入自己的云服务器控制台,点击云服务器实例,找到安全组,然后在你当前使用的安全组中点击配置规则,编辑入方向规则和出方向规则,将数据库端口加一下(默认为3306),然后继续尝试连接。
发现 Navicat 依旧连不上,还是一样被拒绝,又查了查 3306 端口的占用情况:
[email protected]:~$ netstat -an | grep 3306
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
看到 3306 端口绑定的 IP 是 127.0.0.1,我似乎知道了问题所在,需要修改一下 MySQL 服务的配置文件:
sudo vim /etc/mysql/mariadb.conf.d/50-server.cnf
将 bind-address = 127.0.0.1 注释掉即可:
#bind-address = 127.0.0.1
工作太忙并且很长时间没配数据库了,遇到个小问题还花费了点时间,记录一下~
边栏推荐
- Fault analysis - a case of excessive CPU load caused by a large number of short-time processes
- opencv学习笔记一
- Multi scale aligned distillation for low resolution detection
- Introduction to related operations of Huawei cloud sandbox Lab
- oracle 连接PLSQL
- C#/VB. Net to set solid color / gradient / picture background in word
- Research on MySQL open source license
- Ccf-csp 202203-1 uninitialized warning
- FPGA初次尝试
- Some bugs of unity physics engine caused by squeezing
猜你喜欢

ERP starts from internal integration

故障分析 | MySQL 中新建用户无法登陆的一种特殊场景

Handwriting perceptron, KNN, decision tree (ID3) for binary classification of iris

Simple use of Wireshark

Neural network learning (IV) -- a simple summary of the knowledge of each layer of neural network

Practical combat of Youku terminal side bullet screen piercing technology: pixelai mobile terminal real-time portrait segmentation

Understand the difference between cookie+session, redis+token and JWT

Common Android program functions clear cache

FPGA初次尝试

Customized development of blind box app system
随机推荐
What does the seven layer network structure do?
[detailed explanation of kubernetes 12] - Security Certification
Structure of the actual combat battalion | module 3
What is the network transformer for? (Ethernet network LAN LAN communication isolation filter) production plant / product schematic diagram / common products / price influencing factors
[Beijing Normal University] information sharing of the first and second postgraduate entrance examinations
How to get the preferential activities for stock account opening? Is it safe to open an account online?
Vivado HLS int8/9 multiplication optimization
[reinforcement learning notes] V value and Q value in reinforcement learning
The writing speed is increased by tens of times. The application of tdengine in tostar intelligent factory solution
Cw2015 alarm function
SQL审核 | 这里有 MySQL/Oracle 最常用的 SQL 开发规则
À propos de JS console. Log () est un problème de synchronisation ou asynchrone
Excuse me: is it safe for CICC fortune to open an account
Scala - numerical characteristic bucket
Introduction to AI computing power
Zhongang Mining: fluorite resources listed in the strategic mineral catalogue
[play with Huawei cloud] functions and features of Kunpeng code migration tool
Android 程序常用功能《清除缓存》
Do you know the specifications of e-commerce background permission settings!
Laravel determines whether the mailbox already exists and verifies whether the mailbox format is legal