当前位置:网站首页>Container internal mysql5.7 configuration mode sqlmode + timeout wait_ timeout

Container internal mysql5.7 configuration mode sqlmode + timeout wait_ timeout

2022-06-09 02:44:00 I senior cat

 docker run -itd --restart=always --name mysql-test-5.7 -p 3307:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7

docker cp ecce28f29499:/etc/mysql/mysql.cnf .

vim mysql.cnf 

docker cp mysql.cnf  ecce28f29499:/etc/mysql/

docker restart ecce28f29499

 

[mysqld]
sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"

Temporary settings   sql_mode:  navcat 

select @@global.sql_mode;
select @@session.sql_mode;


select @@max_allowed_packet;
show variables like 'max_allowed_packet';

-- set @@global.sql_mode='STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
-- set @@session.sql_mode='STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
-- 
-- 
-- 
-- set @@global.sql_mode='ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
-- set @@session.sql_mode='ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';


set @@global.sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
set @@session.sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';

Temporary settings   Timeout time

SHOW VARIABLES LIKE 'max_connections';
SET GLOBAL max_connections=5000;

show global variables like 'wait_timeout'
SET GLOBAL wait_timeout=6000;

原网站

版权声明
本文为[I senior cat]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/159/202206081157375977.html