mysql连接一段时间后 2002错误

阿里云的win2012服务器 8G内存
phpstudy环境 + VisualSVN
目前服务器上有多个项目 当运行两天左右 内存占用达到28%左右时
1、项目连接mysql时提示2002 无法连接
2、使用TortoiseSvn更新数据时提示 由于系统缓冲区空间不足或队列已满 无法更新
出现此问题时重启服务器解决,当内存再次占用达到28%左右 仍然发生
请各位大神帮忙。

1,你可以去联系官网,或者清理一下电脑缓存
2清理一下电脑缓存。

关闭数据库连接了么?

问题解决过程,执行以下命令,看提示信息
#/usr/bin/mysql_install_db

1
2
3

Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h controller password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

执行
#/usr/bin/mysqld_safe &
执行完成MySQL2002错误就没有了,接着简单设置MySQL密码
#/usr/bin/mysqladmin -u root password 'new-password'
高级设置
Alternatively you can run:
#/usr/bin/mysql_secure_installation

1
2
3
4
5
6
7
8

重启MySQL服务,现在可以用密码登录MySQL,而不会出现error 2002了。
虽然不知道具体的错误原因,但是以上办法的确可以决解问题。

数据库连接正常 并没有达到最大连接数

2002一般都是socket 问题
出现问题的时候不知道你有没有尝试只重启mysql是否正常?
如果能重启就说明服务没问题
那就检查一下 MySQL 的 socket 路径
还有php.ini里头配置的mysql.default_socket路径

然后看看mysql的日志看看具体的错误 ,你这样的描述不太好判断 通过日志来的快

在查找各种解决方案后 通过一种方案得到缓解,目前内存占用达到36% 仍然没倒
图片说明
修改了注册表中的用户最大连接数量 想知道 这个问题的成因 以及后续的注意事项
1、是否与thinkphp的连接数过大 未释放有关系呢?
2、这个最大连接数有没有峰值 是否仍然可以增加 会不会对服务器产生什么影响呢?
忘各位大神解答