首页 > 代码库 > 新安装的MySQL的简单配置
新安装的MySQL的简单配置
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)
| 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)
新安装的MySQL的简单配置
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。