MySQL troubleshooting
This troubleshooting section describes the common pitfalls and errors around configuring, linking, and provisioning MySQL datasets and provides possible solutions. This section explains the following in detail:
Connector logs and the path at which these logs are generated. These logs contain information regarding the flow of events, failure regarding any MySQL command failures, trace messages, etc.
Common MySQL commands. These commands will help you understand how to check replication status, user permissions, etc
Exit Codes and actions that users can take in case of any error.
Version compatibility. This guides the user to upgrade from MySQL version 5.7 to 8.
If the user is still not able to resolve the error, please reach out to Delphix Support.
Logs
There are 2 sets of logs for the MySQL plugin:
Plugin Logs: Plugin logs are part of the Delphix Continuous Data Engine. Refer to How to Retrieve Logs to find out how to get the Delphix Continuous Data Engine Plugin Logs.
MySQL Shell Operation Logs: When the plugin performs certain operations (such as Take backup, Link, Provision, etc.), logs are written to log files on the staging or target host under the Delphix Continuous Data Engine Toolkit directory.
Following are the logs to review:
delphix_mysql_user_mysql_debug.log
delphix_mysql_user_mysql_info.log
delphix_mysql_user_mysql_error.log
Common MySQL commands
Connecting to a MySQL instance
CODEdelphixos> /usr/bin/mysql -u UserName -p Password --protocol=TCP --port=1234
List databases in MySQL
CODEmysql> show databases;
Check the replication status in MySQL
CODEmysql> show replica status;
Check binary logging
CODEmysql> show variables like 'log_bin';
Check user permissions
CODEmysql> show grants for 'delphixdb'@'%';
MySQL Plugin exit codes
The below tables include exit codes that the MySQL connector (plugin) presents if an error occurs.
Exit Code | Description | Possible Reason |
---|---|---|
1 | General Error | Check logs |
2 | General Error | Check logs |
3 | Unable to start MySQL |
|
4 | Missing config file | A |
5 | Unable to change | Delphix was unable to change the password for the root user after creating the staging db. Please check logs. |
6 | Unable to restore backup | Delphix was unable to restore the full backup into staging db. Please check logs. |
7 | Connect failure post restore | Delphix is unable to connect to the staging database after backup is restored.
Check logs for more information on the error. |
8 | Delphix backup failure | Delphix could not take a source database backup.
Check logs for more information on the error. |
9 | Customer backup failure | There was an issue with the customer provided backup.
Check logs for more information on the error. |
10 | Invalid binary path |
|
11 | Connect failure after restart | In Staging Push Mode, the Delphix source user could not connect to the MySQL instance after reboot. Check logs for more information on the error. |
12 | Unable to create user | In Staging Push Mode(Staging Push), there was an error while creating the delphix user after staging db was initialized. Check logs for more information on the error. |
13 | An error occurred while starting replication | Check the provided credentials if they are valid |
14 | An error occurred while granting the permissions | Check the logs for more information, permission error for performing operation. Try creating dSource again. |
15 | An error occurred while starting replication | The user has selected to provide a different replication user and password but the provided replication user or password is empty |
Version compatibility
The MySQL connector requires that the staging and target environment’s MySQL major versions match. This also means that any snapshot’s MySQL version must match the installation on the Target environment. This applies to all VDB operations, such as provision, rollback, and refresh. The operation will fail if the two versions are different, such as MySQL v5.7 on Staging and v8 on Target.
MySQL, unlike other databases, does not support automatic upgrades.
Guidance on how to upgrade your staging environments, target environments, and VDBs can be found in the Upgrading dSources and VDBs MySQL database versions section.
In version 4.1.0 of the MySQL connector, we have introduced guardrails to minimize accidentally broken VDBs when refreshing from a lower versioned dSource. A sample screenshot can be seen below.
![borken vdb.jpg](../../__attachments/205335841/borken%20vdb.jpg?inst-v=9f5cd9ef-94fe-4677-b3c4-6c5d1617af5c)