Thứ Năm, 4 tháng 6, 2020
Plesk How to change the SQL mode in MySQL
Applicable to: Plesk for Linux Plesk for Windows
Question
How to change the 'sql-mode' variable in MySQL?
Answer
Listing currently enabled SQL modes
Connect to MySQL server.
Run the following query:
mysql> SELECT @@sql_mode;
Setting the SQL mode permanently
Open the MySQL configuration file my.cnf (my.ini on Windows) in a text editor. In this example, we use the vi editor on Linux and Notepad on Windows:
on CentOS/RHEL-based distributions:
vi /etc/my.cnf
on Debian/Ubuntu-based distributions:
vi /etc/mysql/my.cnf
on Plesk for Windows Server for clients' databases:
notepad %plesk_dir%Databases\MySQL\my.ini
Add the sql-mode variable and specify required SQL modes on a new line under the [mysqld] section:
sql-mode = 'sql-mode-name1,sql-mode-name2'
where sql-mode-nameX is an SQL mode
Note: To disable the SQL mode permanently add sql-mode = '' under the [mysqld] section.
Restart the MySQL service using the command appropriate for your MySQL version:
service mariadb restart
# service mysql restart
# service mysqld restart
On Plesk for Windows Server, restart the MySQLXX service via Plesk Services Monitor.
Setting the SQL mode temporarily for the current connection
Connect to MySQL server.
Run the following query to set required SQL modes:
mysql> SET sql_mode = 'sql-mode-name1,sql-mode-name2';
where sql-mode-nameX is an SQL mode
Disabling the SQL mode temporarily for the current connection
Connect to MySQL server.
Run the following query:
mysql> SET sql_mode = '';
Disabling the SQL mode temporarily for the current connection
SET GLOBAL sql_mode = 'modes';
Share This!
Đăng ký:
Đăng Nhận xét (Atom)
10 Tut - Sharing Tip And Tut: Plesk How To Change The Sql Mode In Mysql >>>>> Download Now
Trả lờiXóa>>>>> Download Full
10 Tut - Sharing Tip And Tut: Plesk How To Change The Sql Mode In Mysql >>>>> Download LINK
>>>>> Download Now
10 Tut - Sharing Tip And Tut: Plesk How To Change The Sql Mode In Mysql >>>>> Download Full
>>>>> Download LINK