How to set sql_mode permanently in MySQL?

MySQLMySQLi Database

If you are using Windows Operating System, check your directory my.cnf or my.ini file.

mysql> select @@datadir;

The following is the output

+---------------------------------------------+
| @@datadir                                   |
+---------------------------------------------+
| C:\ProgramData\MySQL\MySQL Server 8.0\Data\ |
+---------------------------------------------+
1 row in set (0.00 sec)

Reach the above location ‘C:\ProgramData\MySQL\MySQL Server 8.0\Data\”. The screenshot is as follows for my.cnf file

Open the my.cnf file and write the sql_mode="TRADITIONAL". The syntax is as follows

sql_mode="TRADITIONAL".

After that start your server once again.

raja
Published on 16-Jan-2019 13:06:54
Advertisements