Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ ms.custom:

[!INCLUDE [azure-database-for-mysql-single-server-deprecation](~/reusable-content/ce-skilling/azure/includes/mysql/includes/azure-database-for-mysql-single-server-deprecation.md)]

Azure Database for MySQL flexible server is a fully managed service powered by the community version of MySQL. The MySQL experience in a managed service environment might differ from running MySQL in your own environment. In this article, you'll see some of the common errors users might encounter while migrating to or developing on Azure Database for MySQL flexible server for the first time.
Azure Database for MySQL Flexible Server is a fully managed service powered by the community version of MySQL. The MySQL experience in a managed service environment might differ from running MySQL in your own environment. In this article, you'll see some of the common errors users might encounter while migrating to or developing on Azure Database for MySQL Flexible Server for the first time.

## Common Connection Errors

### ERROR 1184 (08S01): Aborted connection 22 to db: 'db-name' user: 'user' host: 'hostIP' (init_connect command failed)

The above error occurs after successful sign-in but before executing any command when session is established. The above message indicates you have set an incorrect value of `init_connect` server parameter, which is causing the session initialization to fail.

There are some server parameters like `require_secure_transport` that aren't supported at the session level, and so trying to change the values of these parameters using `init_connect` can result in Error 1184 while connecting to the Azure Database for MySQL flexible server instance as shown below:
There are some server parameters like `require_secure_transport` that aren't supported at the session level, and so trying to change the values of these parameters using `init_connect` can result in Error 1184 while connecting to the Azure Database for MySQL Flexible Server instance as shown below:

mysql> show databases;
ERROR 2006 (HY000): MySQL server has gone away
Expand Down Expand Up @@ -55,7 +55,7 @@ BEGIN
END;
```

**Resolution**: To resolve the error, set `log_bin_trust_function_creators` to 1 from [server parameters](../single-server/how-to-server-parameters.md) blade in portal, execute the DDL statements or import the schema to create the desired objects. You can continue to maintain `log_bin_trust_function_creators` to 1 for your server to avoid the error in future. Our recommendation is to set `log_bin_trust_function_creators` as the security risk highlighted in [MySQL community documentation](https://dev.mysql.com/doc/refman/5.7/en/replication-options-binary-log.html#sysvar_log_bin_trust_function_creators) is minimal in Azure Database for MySQL flexible server as bin log isn't exposed to any threats.
**Resolution**: To resolve the error, set `log_bin_trust_function_creators` to 1 from [server parameters](../single-server/how-to-server-parameters.md) blade in portal, execute the DDL statements or import the schema to create the desired objects. You can continue to maintain `log_bin_trust_function_creators` to 1 for your server to avoid the error in future. Our recommendation is to set `log_bin_trust_function_creators` as the security risk highlighted in [MySQL community documentation](https://dev.mysql.com/doc/refman/5.7/en/replication-options-binary-log.html#sysvar_log_bin_trust_function_creators) is minimal in Azure Database for MySQL Flexible Server as bin log isn't exposed to any threats.

#### ERROR 1227 (42000) at line 101: Access denied; you need (at least one of) the SUPER privilege(s) for this operation. Operation failed with exitcode 1

Expand Down Expand Up @@ -84,7 +84,7 @@ DELIMITER ;

#### ERROR 1227 (42000) at line 295: Access denied; you need (at least one of) the SUPER or SET_USER_ID privilege(s) for this operation

The above error might occur while executing CREATE VIEW with DEFINER statements as part of importing a dump file or running a script. Azure Database for MySQL flexible server doesn't allow SUPER privileges or the SET_USER_ID privilege to any user.
The above error might occur while executing CREATE VIEW with DEFINER statements as part of importing a dump file or running a script. Azure Database for MySQL Flexible Server doesn't allow SUPER privileges or the SET_USER_ID privilege to any user.

**Resolution**:

Expand All @@ -97,7 +97,7 @@ The above error might occur while executing CREATE VIEW with DEFINER statements

#### ERROR 1227 (42000) at line 18: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

The above error might occur if you're using trying to import the dump file from an Azure Database for MySQL flexible server instance with GTID enabled to the target Azure Database for MySQL flexible server instance. Mysqldump adds SET @@SESSION.sql_log_bin=0 statement to a dump file from a server where GTIDs are in use, which disables binary logging while the dump file is being reloaded.
The above error might occur if you're using trying to import the dump file from an Azure Database for MySQL Flexible Server instance with GTID enabled to the target Azure Database for MySQL Flexible Server instance. Mysqldump adds SET @@SESSION.sql_log_bin=0 statement to a dump file from a server where GTIDs are in use, which disables binary logging while the dump file is being reloaded.

**Resolution**:
To resolve this error while importing, remove or comment out the below lines in your mysqldump file and run import again to ensure it's successful.
Expand All @@ -109,7 +109,7 @@ SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN;

## Common connection errors for server admin sign-in

When an Azure Database for MySQL flexible server instance is created, a server admin sign-in is provided by the end user during the server creation. The server admin sign-in allows you to create new databases, add new users and grant permissions. If the server admin sign-in is deleted, its permissions are revoked or its password is changed, you might start to see connections errors in your application while connections. Following are some of the common errors.
When an Azure Database for MySQL Flexible Server instance is created, a server admin sign-in is provided by the end user during the server creation. The server admin sign-in allows you to create new databases, add new users and grant permissions. If the server admin sign-in is deleted, its permissions are revoked or its password is changed, you might start to see connections errors in your application while connections. Following are some of the common errors.

### ERROR 1045 (28000): Access denied for user 'username'@'IP address' (using password: YES)

Expand All @@ -121,13 +121,13 @@ The above error occurs if:

**Resolution**:

- Validate if "username" exists as a valid user in the server or is accidentally deleted. You can execute the following query by logging into the Azure Database for MySQL flexible server user:
- Validate if "username" exists as a valid user in the server or is accidentally deleted. You can execute the following query by logging into the Azure Database for MySQL Flexible Server user:

```sql
select user from mysql.user;
```

- If you can't sign in to the Azure Database for MySQL flexible server instance to execute the above query itself, we recommend you to [reset the admin password using Azure portal](../single-server/how-to-create-manage-server-portal.md). The reset password option from Azure portal will help recreate the user, reset the password, and restore the admin permissions, which will allow you to sign in using the server admin and perform further operations.
- If you can't sign in to the Azure Database for MySQL Flexible Server instance to execute the above query itself, we recommend you to [reset the admin password using Azure portal](../single-server/how-to-create-manage-server-portal.md). The reset password option from Azure portal will help recreate the user, reset the password, and restore the admin permissions, which will allow you to sign in using the server admin and perform further operations.

## Related content

Expand Down