bind-address:监听的IP地址
max_connect_errors:最大允许错误次数(注:是访问协议错误,若某个IP错误次数达到该阈值,则被屏蔽)
max_connections :最大连接数(能同时访问server的连接个数,若达到该阈值,则不能再连接到server)
skip_name_resolve :跳过域名反解
back_log :创建TCP连接时,允许的最大同时未完成的连接个数
expire_logs_days :binlog的保留天数
注:
datadir和log-error和log-bin等对应目录需要确保已创建,并且权限为mysql所有。
例如:
mkdir -p /data/mysql
chown -R mysql.mysql /data/mysql
mkdir -p /var/log/mysql
chown -R mysql.mysql /var/log/mysql
配置完成后,启动mysql:
/etc/init.d/mysqld start
mysql> SELECT user,host FROM MYSQL.USER;
+------+-----------+
| user | host |
+------+-----------+
| root | 127.0.0.1 |
| root | ::1 |
| | localhost |
| root | localhost |
+------+-----------+
4 rows in set (0.00 sec)
mysql> DROP USER ‘‘@localhost;
Query OK, 0 rows affected (0.25 sec)
mysql> DROP USER ‘root‘@‘::1‘;
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT user,host FROM MYSQL.USER;
+------+-----------+
| user | host |
+------+-----------+
| root | 127.0.0.1 |
| root | localhost |
+------+-----------+
2 rows in set (0.00 sec)