If Navicat for MySQL 8.0.x reports a connection error with MariaDB, follow these steps to diagnose and resolve the issue:
Check Network Connectivity
Ensure the MariaDB server is reachable from your client machine. Use ping or telnet to verify the connection:
ping <MariaDB_server_IP>
telnet <MariaDB_server_IP> 3306
If the port is blocked, check firewall settings or security groups (e.g., Tencent Cloud Security Group rules).
Verify MariaDB Server Status
Confirm MariaDB is running on the server:
systemctl status mariadb
If stopped, restart it:
systemctl start mariadb
Check User Privileges
Ensure the MySQL user has the correct permissions to connect from the client IP. Log in to MariaDB locally and run:
SELECT host, user FROM mysql.user;
GRANT ALL PRIVILEGES ON *.* TO 'username'@'client_IP' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
Replace username, client_IP, and password with your credentials.
Validate Connection Settings in Navicat
Double-check the connection details in Navicat:
127.0.0.1 or remote server IP).3306).Check MariaDB Configuration
Verify bind-address in /etc/mysql/my.cnf or /etc/mysql/mariadb.conf.d/50-server.cnf:
bind-address = 0.0.0.0 # Allows remote connections
Restart MariaDB after changes:
systemctl restart mariadb
Enable Logging for Debugging
Check MariaDB error logs for details:
tail -f /var/log/mysql/error.log
Tencent Cloud-Specific Recommendations
If using Tencent Cloud, ensure:
3306 from your client IP.Example: If connecting from a remote machine, ensure the Tencent Cloud Security Group allows 3306 from your IP, and the MariaDB user has % (any host) or your specific IP in privileges.