• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

How to Fix MySQL Error 1290 – SQLSTATE: HY000 (ER_OPTION_PREVENTS_STATEMENT) The MySQL server is running with the %s option so it cannot execute this statement

December 20, 2023

How to Fix MySQL Error 1290 – SQLSTATE: HY000 (ER_OPTION_PREVENTS_STATEMENT) The MySQL server is running with the %s option so it cannot execute this statement

MySQL is a popular open-source relational database management system used by many websites and applications. However, like any software, it can encounter errors that can disrupt its normal operation. One such error is MySQL Error 1290, also known as SQLSTATE: HY000 (ER_OPTION_PREVENTS_STATEMENT). This error occurs when the MySQL server is running with a specific option that prevents the execution of certain statements. In this article, we will explore the causes of this error and provide solutions to fix it.

Causes of MySQL Error 1290

MySQL Error 1290 is typically caused by the SQL mode settings of the MySQL server. The SQL mode determines the behavior of the MySQL server and can restrict certain statements or operations. When the server is running with the %s option, it means that a specific SQL mode is enabled, which prevents the execution of certain statements.

There are several SQL modes that can trigger this error, such as STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, and others. These modes enforce strict data validation and can prevent the execution of statements that do not comply with the specified rules.

Fixing MySQL Error 1290

To fix MySQL Error 1290, you need to modify the SQL mode settings of the MySQL server. There are several ways to achieve this:

1. Modifying the Configuration File

The MySQL configuration file, usually named my.cnf or my.ini, contains various settings for the MySQL server. You can open this file and locate the section that defines the SQL mode. It typically looks like this:

[mysqld]
sql_mode=...

You can remove or comment out the sql_mode line by adding a ‘#’ symbol at the beginning of the line. Save the file and restart the MySQL server for the changes to take effect.

2. Modifying the SQL Mode at Runtime

If you have the necessary privileges, you can modify the SQL mode at runtime using the following command:

SET GLOBAL sql_mode='...';

Replace ‘…’ with the desired SQL mode settings. This change will take effect immediately, but it will be reset when the MySQL server restarts. To make the change permanent, you can also modify the configuration file as mentioned in the previous method.

3. Modifying the SQL Mode for a Session

If you want to modify the SQL mode for a specific session only, you can use the following command:

SET SESSION sql_mode='...';

This command will change the SQL mode for the current session only. Once the session ends, the SQL mode will revert to the default settings.

Conclusion

MySQL Error 1290 (SQLSTATE: HY000) can be caused by the SQL mode settings of the MySQL server. By modifying the SQL mode, either in the configuration file or at runtime, you can fix this error and allow the execution of the desired statements. Remember to carefully consider the implications of changing the SQL mode, as it can affect the behavior and data validation of the MySQL server.

Summary

If you encounter MySQL Error 1290 – SQLSTATE: HY000 (ER_OPTION_PREVENTS_STATEMENT), it means that the MySQL server is running with a specific option that prevents the execution of certain statements. To fix this error, you can modify the SQL mode settings of the MySQL server. This can be done by modifying the configuration file, using runtime commands, or modifying the SQL mode for a specific session. For more information on MySQL hosting solutions, visit Server.HK.

Recent Posts

  • NVMe SSD vs SATA SSD for VPS Hosting: Does Storage Type Really Matter?
  • Hong Kong VPS Docker Setup: Run Containers with Full Root Access
  • How to Set Up a Game Server on Hong Kong VPS: Low-Latency Gaming for Asia
  • How to Deploy a Node.js Application on Hong Kong VPS: Complete Guide
  • How to Set Up a WordPress Site on a Hong Kong VPS with aaPanel (Step-by-Step 2026)

Recent Comments

  1. hello world on Top 5 Use Cases for a Hong Kong Dedicated Server in 2026

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot