Mysql:my.cnf中的修改没有生效

Ewo*_*oud 7 mysql my.cnf

my.cnf用以下行更新了我的数据库文件:max_connections=200.之后我停止并启动了mysql服务,以便更改生效.

但由于某种原因,此更改不会影响数据库,因为如果我运行:

mysql> select @@max_connections
Run Code Online (Sandbox Code Playgroud)

它显示最大连接数为100.

显然,还有一些地方可以管理这个价值.我在哪里可以找到它或者我做错了什么?

谢谢您的回复.

Mat*_*ean 8

确保[mysqld]部分下的max_connections:

例如:

[mysqld]
socket=/path/to/mysql.sock
datadir=/var/lib/mysql
max_connections=200

[client]
#mysql-client settings here..
Run Code Online (Sandbox Code Playgroud)


Mar*_*555 7

尝试运行mysqld --verbose --help以查看mysqld实际读取的配置文件以及使用的参数和值.输出将如下所示:

mysqld  Ver 5.0.51a-24-log for debian-linux-gnu on x86_64 ((Debian))
Copyright (C) 2000 MySQL AB, by Monty and others
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Default options are read from the following files in the given order:
/etc/mysql/my.cnf ~/.my.cnf /usr/etc/my.cnf
The following groups are read: mysql_cluster mysqld server mysqld-5.0

Variables (--variable-name=value)
and boolean options {FALSE|TRUE}  Value (after reading options)
--------------------------------- -----------------------------
...

To see what values a running MySQL server is using, type
'mysqladmin variables' instead of 'mysqld --verbose --help'.