几分钟后,我不断失去我的 MySQL 连接。在我尝试连接之前,我在日志中看不到任何错误。
我很高兴发布任何有助于调试的设置,请告诉我您需要查看的内容。
上下文.xml:
<Resource name="jdbc/mysql" auth="Container" type="javax.sql.DataSource"
initialSize="10" maxActive="50" maxIdle="20" maxWait="60000"
driverClassName="com.mysql.jdbc.Driver"
poolPreparedStatements="true"
username="orbeon"
password="pw"
url="jdbc:mysql://localhost:3306/orbeon"/>
我的.cnf:
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
skip-external-locking
skip-name-resolve
bind-address = 0.0.0.0
key-buffer = 256M
thread_stack = 256K
thread_cache_size = 8
max_allowed_packet = 16M
max_connections = 200
myisam-recover = BACKUP
wait_timeout = 180
net_read_timeout = 30
net_write_timeout = 30
back_log = 128
table_cache = 128
max_heap_table_size = 32M
lower_case_table_names = 0
query_cache_limit = 1M
query_cache_size = 16M
log_error = /var/log/mysql/error.log
log_slow_queries = /var/log/mysql/slow.log
long-query-time = 5
log-queries-not-using-indexes
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
[isamchk]
key-buffer = 256M
max_allowed_packet = 16M
!includedir /etc/mysql/conf.d/