Troubleshooting MYSQL or MariaDB Errors from Error 1221 to 1230


MariaDB ERROR Code 1221
MySQL SQL State HY000
Incorrect usage of %s and %s
MariaDB ERROR Code 1222
MySQL SQL State 21000
The used SELECT statements have a different number of columns
MariaDB ERROR Code 1223
MySQL SQL State HY000
Can’t execute the query because you have a conflicting read lock

MariaDB ERROR Code 1224
MySQL SQL State HY000
Mixing of transactional and non-transactional tables is disabled
MariaDB ERROR Code 1225
MySQL SQL State HY000
Option ‘%s’ used twice in statement
MariaDB ERROR Code 1226
MySQL SQL State 42000
User ‘%s’ has exceeded the ‘%s’ resource (current value: %ld)

MariaDB ERROR Code 1227
MySQL SQL State 42000
Access denied; you need (at least one of) the %s privilege(s) for this operation
MariaDB ERROR Code 1228
MySQL SQL State HY000
Variable ‘%s’ is a SESSION variable and can’t be used with SET GLOBAL
MariaDB ERROR Code 1229
MySQL SQL State HY000
Variable ‘%s’ is a GLOBAL variable and should be set with SET GLOBAL
MariaDB ERROR Code 1230
MySQL SQL State 42000
Variable ‘%s’ doesn’t have a default value

Above are the list of shared MySQL and MariaDB Error Codes and their Description including SQL state and exact error code from Error 1221 to 1230 which performing certain operations against MySQL or MariaDB.

What are MYSQL/MariaDB Errors?

MySQL and MariaDB programs have access to several types of common error information when the server returns an error.

The MYSQL/MariaDB message displayed contains three types of information:
A numeric error code. This number is MySQL-specific and is not portable to other database systems.
A five-character SQLSTATE value. The values are specified by ANSI SQL and ODBC and are more standardized. Not all MySQL error numbers are mapped to SQLSTATE error codes.
A message string that provides a textual description of the error.
When an error occurs, you can access the MySQL error code, the SQLSTATE value, and the message string using C API functions:
MySQL error code: Call mysql_errno()
SQLSTATE value: Call mysql_sqlstate()
Error message: Call mysql_error()

Hope this was helpful.

SQLServerF1 Team
Information about MYSQL and MariaDB Error Codes and Error Messages or Warnings on Windows, Linux Operating Systems.