Strict SQL mode makes MySQL and MariaDB reject bad data instead of quietly changing it. On Domain India shared hosting you can't switch it off for the whole server, but your own application can turn it off for its own database connection with one statement. This page explains how, and why fixing the query is usually the better answer.
For what each SQL mode does, including ONLY_FULL_GROUP_BY, read What is SQL mode and why ONLY_FULL_GROUP_BY matters.
The server-wide (global) SQL mode on our cPanel and DirectAdmin shared servers includes STRICT_TRANS_TABLES, and shared hosting accounts can't change it. Your application can change the mode for its own connection with SET SESSION sql_mode = '…' straight after connecting, and that works on shared hosting. Treat it as a stopgap: strict mode is refusing data that would otherwise be cut short or changed without warning. On a VPS you can set the global mode yourself.
1. What strict mode does
With strict mode on, MySQL and MariaDB refuse an INSERT or UPDATE that contains a value the column can't hold. Without it, the server stores a changed value and only raises a warning that most applications never read.
| Error you see with strict mode | What happens without strict mode |
|---|---|
| Data too long for column | The text is cut to fit |
| Incorrect integer value: '' for column | An empty string becomes 0 |
| Field doesn't have a default value | The column gets an implicit default |
| Incorrect datetime value | The date is stored as 0000-00-00 |
So the error is a warning sign, not the problem itself. Switching strict mode off hides it, and the bad data is stored anyway.
2. What our shared servers use
On 23 September 2026 the global mode on Domain India's cPanel and DirectAdmin shared servers, which run MariaDB, was STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION. Strict mode is on; ONLY_FULL_GROUP_BY is off.
You can see the modes for yourself in phpMyAdmin's SQL tab:
SELECT @@GLOBAL.sql_mode, @@SESSION.sql_mode;Changing the global mode needs server administrator rights, and it would change the behaviour of every database on the server. That is why SET GLOBAL and my.cnf changes aren't available on shared hosting.
3. Turn strict mode off for your own connection
Run this once, right after your application connects. It lasts until that connection closes and affects nothing else:
SET SESSION sql_mode = 'ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';In PHP with PDO:
$pdo = new PDO($dsn, $user, $pass);
$pdo->exec("SET SESSION sql_mode = 'ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'");With mysqli, run the same statement with $mysqli->query() after connecting.
Frameworks have a setting for this:
- Laravel: set
'strict' => falsefor the connection inconfig/database.php, or list exact modes in itsmodesarray. - WordPress already removes strict modes from its own connection, so WordPress core isn't affected. Errors from a plugin usually mean the plugin's own queries need fixing.
In phpMyAdmin, a SET SESSION statement only applies to statements run in the same SQL box, because each request opens a new connection.
4. The better fix: correct the data or the column
- Read the full error.It names the column and the problem.
- Fix the value.Send
NULLor a real number instead of an empty string, and a valid date instead of0000-00-00. - Fix the column.Make it longer if real text doesn't fit, allow
NULL, or give it a default value. - Test with strict mode on,so your code keeps working when you move to another server.
You can change a column in phpMyAdmin's Structure tab. Back up the database first; see how to back up a MySQL database using phpMyAdmin.
5. On a VPS
On a Domain India VPS you have root access, so you can set the global SQL mode in the database server's configuration file and restart it. Even there, keeping strict mode on and fixing the queries is the safer choice.
- 1 vCPU
- 2 GB DDR4 RAM
- 64 GB NVMe SSD Storage
- 2 TB Monthly Bandwidth
The card shows the live list price, excluding 18% GST.
Can I disable strict SQL mode on Domain India shared hosting?
Not for the whole server, but your application can turn it off for its own connection by running SET SESSION sql_mode with a list that leaves out STRICT_TRANS_TABLES, straight after connecting. The global mode can't be changed by shared hosting accounts.
What is the global sql_mode on Domain India shared hosting?
On 23 September 2026 the global mode on our cPanel and DirectAdmin shared servers was STRICT_TRANS_TABLES, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER and NO_ENGINE_SUBSTITUTION. Strict mode is on and ONLY_FULL_GROUP_BY is off.
Why do I get "Data too long for column" or "Incorrect integer value"?
Strict mode is refusing a value the column can't hold, instead of cutting or changing it. Fix the value your code sends, or change the column so it can hold it, rather than switching strict mode off.
How do I turn off strict mode in Laravel?
Set 'strict' => false for the connection in config/database.php, or list the exact modes you want in the connection's modes array.
Is it safe to turn strict mode off?
It works, but it lets invalid data into your database without an error, such as text cut short or empty values stored as zero. Use it only as a temporary measure while you fix the queries.
Ready to fix the error? Check your modes with SELECT @@SESSION.sql_mode; in phpMyAdmin, follow the steps above, and open a support ticket with the exact error message if a query still fails.
Send us the exact error message, the query or page that causes it and the database name, and we will help you find the cause.
Open a support ticket