MySQL troubleshooting
This document provides solutions for issues that may occur when using the MySQL service.
Unable to connect between client and MySQL instance in VPC
If you are unable to connect to port 3306
or 3307
of the MySQL instance (cluster), consider the following common causes:
Check availability status
A newly created DB instance will remain in the Creating
state until it is ready. You can connect to it once its status changes to Available
.
Refer to Instance Group Availability Status for more details.
Instance Group Status | Availability | Description |
---|---|---|
AVAILABLE | READY | All configurations are complete |
Test connection to DB instance
-
On Linux or Unix, you can test connectivity from a terminal using the command below. Replace
"DB-INSTANCE-ENDPOINT"
and"PORT"
with your actual endpoint and port.Test Instance Connectionnc -vz "DB-INSTANCE-ENDPOINT" "PORT"
Example:
Sample Testubuntu@host-172-16-3-252:~$ nc -vz "DB-INSTANCE-ENDPOINT" "PORT"
Connection to "DB-INSTANCE-ENDPOINT" (172.16.3.154) "PORT" port [tcp/mysql] succeeded! -
On Windows, you can test the connection to the DB instance using
Telnet
.Telnet is supported only for connection testing purposes. If the connection is successful, no message will be displayed. If the connection fails, an error message will appear.
Connection testC:\Users\Administrator>telnet "DB-INSTANCE-ENDPOINT" "PORT"
Connecting to "DB-INSTANCE-ENDPOINT"...Could not open connection to the host, on port "PORT": Connect failed
Lost DB instance owner password
If you have lost the owner password for the DB instance, please contact the KakaoCloud Helpdesk.
Category | Description |
---|---|
{MySQL-ADMIN-PASSWORD} | ⚠️ The admin password can be changed after the database has started. ⚠️ Once changed by the user, the admin password cannot be retrieved. |
DB instance storage shortage
If the storage capacity is insufficient, DB instance operations may not function properly.
▶️ Solution: Expand the storage using the volume expansion feature to keep the DB instance's storage usage below 80%. Below is a sample command and return message.
mysql> create table test(test_name varchar(20), test_age int);
"No response"
Unable to view slow queries (Monitoring > Log Explorer)
In the MySQL service, slow queries are stored as files and can be viewed via Monitoring > Log Explorer.
Logs older than 5 days
By default, Log Explorer only retains and displays slow query log data for up to 5 days. Logs older than 5 days cannot be accessed.
▶️ Solution: If you need to retain logs for more than 5 days, change the log storage location from file to table using Stored Procedures.
If you are unable to access logs within 5 days, please contact the KakaoCloud Helpdesk.
SSH error message: Access denied
ERROR 1044 (42000): Access denied for user 'user'@'%' to database 'database'
This error occurs when creating a user or assigning privileges.
mysql> CREATE USER 'user'@'%' IDENTIFIED BY '1234';
mysql> GRANT ALL PRIVILEGES ON user.* TO 'user'@'%';
ERROR 1044 (42000): Access denied for user 'admin'@'%' to database 'database'
▶️ Solution: Manage accounts and privileges using the default stored procedures provided by KakaoCloud MySQL. For detailed instructions, please refer to Account Setup and Privileges.