How to change SQL_MODE in MySQL Permanently
This is very simple article to set the mysql mode permanently inside your Mysql Server 5.7 or above versions. I tried some articles and finally found this to helpfull for someone who came with same issue. Usually some queries needs to change the sql mode permanently, Otherwise you need to write set mode everytime. I got stressed to set sql_mode on every query. So I came up with a solution for “How to change SQL_MODE in MySQL Permanently?”. Hope this will helpfull to someone who comes with same issue.
I am here using Ubuntu. So let me give by stating with Ubuntu.
Linux(Ubuntu) & MySQL:
Ubuntu and other debian based linux and some of the other Linux operating systems are similar to this solution. Just goto this directory
Lets add a sql_mode permanently here to take effect. under [mysqld]
just add one more line like the below.
Thats it. You can add more than one mode
Windows & MySQL
Its easy for windows users, There you might have XAMPP or WAMPP. Within it C:/xampp/mysql/mysqld.conf . And do the same of linux and add the sql_mode=”;
Here you can set other modes as well. Some of the modes I have listed here.
May be I have missed some modes. But you can refere with mysql site to get it.