# mysql poll



## hurricane_sh (May 11, 2011)

What does the poll command do? Thanks!


```
# /usr/local/etc/rc.d/mysql-server poll
```


----------



## DutchDaemon (May 11, 2011)

According to /etc/subr it's this:


```
poll)
                        _run_rc_precmd || return 1
                        if [ -n "$rc_pid" ]; then
                                wait_for_pids $rc_pid
                        fi
                        _run_rc_postcmd
                        ;;
```

What it appears to do (on its own) is track down the PID and 'wait for it indefinitely' without actually going anywhere. So perhaps it's supposed to be used in conjunction with other things, as indicated by this information:


```
#       ${rc_arg}_precmd n      If set, run just before performing the
#                               ${rc_arg}_cmd method in the default
#                               operation (i.e, after checking for required
#                               bits and process (non)existence).
#                               If this completes with a non-zero exit code,
#                               don't run ${rc_arg}_cmd.
#
#       ${rc_arg}_postcmd n     If set, run just after performing the
#                               ${rc_arg}_cmd method, if that method
#                               returned a zero exit code.
```

`sh -x /usr/local/etc/rc.d/mysql-server poll` and `sh -xv /usr/local/etc/rc.d/mysql-server poll` don't really shed much light either, so it is probably an 'intermediary' command that needs to be run in between other commands.


----------



## hurricane_sh (May 11, 2011)

Many thanks for your reply! I have another question: I changed a setting (max_connection) in my.cnf, is it possible to reload MySQL configuration file without restarting it?


----------



## SirDice (May 12, 2011)

You'll have to restart it.


----------



## Mr-T (Jun 10, 2011)

SirDice said:
			
		

> You'll have to restart it.



Actually the max_connections variable is a global variable, and it can be configured directly through mysql, although note, to ensure when mysql restarts next time, this value is enforced, ensure you update it in the /etc/my.cnf file too.


```
mysql> SHOW VARIABLES LIKE 'max_connections';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| max_connections | 151   |
+-----------------+-------+
1 row in set (0.00 sec)

mysql> SET GLOBAL max_connections=200;
Query OK, 0 rows affected (0.00 sec)

mysql> SHOW VARIABLES LIKE 'max_connections';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| max_connections | 200   |
+-----------------+-------+
1 row in set (0.00 sec)

mysql>
```


----------



## hurricane_sh (Jun 10, 2011)

Thanks, Mr T! That was very useful.


----------



## SirDice (Jun 10, 2011)

A lot of settings can indeed be changed 'on-the-fly' as they say. But keep in mind that not all of them can. Also note that if you really want to re-read the my.cnf file you'll have to restart mysql.


----------

