我在angular2 +中使用Observables,它会命中nodejs,后者是从mysql数据库中获取数据的服务器.observables用于获取实时数据,因此angular在上述时间间隔内会命中mysql数据库。
代码-
// Observables
Observable.interval(10000).subscribe(x => {
this.viewEntireData();
});
所以我将sql变量设置为-
max_connections;
interactive_timeout;
wait_timeout;
connect_timeout;
mysql> show variables like 'max_connections';
+-----------------+--------+
| Variable_name | Value |
+-----------------+--------+
| max_connections | 100000 |
+-----------------+--------+
mysql>show variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 8800 |
+---------------+-------+
mysql> show variables like 'interactive_timeout';
+---------------------+-------+
| Variable_name | Value |
+---------------------+-------+
| interactive_timeout | 8800 |
+---------------------+-------+
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| connect_timeout | 100 |
+-----------------+-------+
有了这些变量值,我的服务器就关闭了。我收到错误消息-
Error: Connection lost: The server closed the connection.
现在,我希望我的连接永远不会关闭或结束。可能吗。请帮忙。
已更新
@Micheal-sqlbot
我的变量是-
mysql> SELECT @@log_warnings;
+----------------+
| @@log_warnings |
+----------------+
| 2 |
+----------------+
mysql> select @@version;
+-------------------------+
| @@version |
+-------------------------+
| 5.7.22-0ubuntu0.16.04.1 |
+-------------------------+
mysql> select @@log_error_verbosity;
+-----------------------+
| @@log_error_verbosity |
+-----------------------+
| 3 |
+-----------------------+
但是我仍然遇到错误-
“错误:ER_CON_COUNT_ERROR:连接过多”
请帮助。根据您的帖子,一切都很好。还是错误。