You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
时间: 2024-04-28 12:24:31 浏览: 315
这是 MySQL 数据库的一个提示信息,意思是如果您想要使用 --expire-logs-days 或者 --binlog-expire-logs-seconds 参数来自动清理二进制日志文件,那么您需要先使用 --log-bin 参数来开启二进制日志记录功能。二进制日志记录可以记录数据库的所有更改操作,包括 INSERT、UPDATE 和 DELETE 等语句,以便您在需要时进行数据恢复、备份和复制等操作。如果您需要更多关于 MySQL 数据库的信息,可以继续提问。
相关问题
port = 3306 socket = /tmp/mysql.sock datadir = /www/server/data default_storage_engine = InnoDB performance_schema_max_table_instances = 400 table_definition_cache = 400 skip-external-locking key_buffer_size = 256M max_allowed_packet = 100G table_open_cache = 1024 sort_buffer_size = 4M net_buffer_length = 4K read_buffer_size = 4M read_rnd_buffer_size = 256K myisam_sort_buffer_size = 64M thread_cache_size = 128 query_cache_size = 128M tmp_table_size = 128M sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES explicit_defaults_for_timestamp = true #skip-name-resolve max_connections = 500 max_connect_errors = 100 open_files_limit = 65535 log-bin=mysql-bin log_error=/var/log/mysql/error.log binlog_format=mixed server-id = 1 expire_logs_days = 10 slow_query_log=1 slow-query-log-file=/www/server/data/mysql-slow.log long_query_time=3 #log_queries_not_using_indexes=on early-plugin-load = "" innodb_data_home_dir = /www/server/data innodb_data_file_path = ibdata1:10M:autoextend innodb_log_group_home_dir = /www/server/data innodb_buffer_pool_size = 1024M innodb_log_file_size = 512M innodb_log_buffer_size = 128M innodb_flush_log_at_trx_commit = 1 innodb_lock_wait_timeout = 50 innodb_max_dirty_pages_pct = 90 innodb_read_io_threads = 4 innodb_write_io_threads = 4 #skip-grant-tables bind-address = 0.0.0.0 为什么把bind-address改成101.201.118.49就不能用了?
将 的 `bind-address` 配置项更改为特定的 IP 地址会导致 MySQL 仅监听该 IP 地址上的连接请求。如果您将 `bind-address` 修改为 `101.201.118.49` 并且无法连接到 MySQL,可能是由于以下原因之一:
1. 防火墙配置:请确保防火墙允许来自 `101.201.118.49` 的连接请求到达 MySQL 服务器的 `3306` 端口。您可以检查防火墙规则并相应地调整配置。
2. IP 地址绑定的网络接口:如果 `101.201.118.49` 不是该服务器上的有效网络接口地址,MySQL 无法侦听该地址上的连接请求。请确保在服务器上存在具有 `101.201.118.49` IP 地址的网络接口,并且该接口处于活动状态。
3. MySQL 用户权限:检查 MySQL 用户的权限配置,确保允许来自 `101.201.118.49` 的连接请求。您可以使用以下命令检查和修改用户权限:
```
mysql -u root -p
GRANT ALL PRIVILEGES ON *.* TO 'your_username'@'101.201.118.49' IDENTIFIED BY 'your_password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
```
请注意,将 `bind-address` 配置项更改为特定的 IP 地址可能会限制仅允许来自该 IP 地址的连接请求。如果您需要允许其他 IP 地址连接到 MySQL,请相应地调整配置。
the syntax 'expire-logs-days' is deprecated and will be removed in a future
version of MySQL. Please use 'binlog_expire_logs_seconds' instead. This warning message is indicating that the syntax 'expire-logs-days' which is used to specify the number of days to keep binary logs in MySQL, is no longer supported and will be removed in a future version of MySQL. Instead, the syntax 'binlog_expire_logs_seconds' should be used to specify the number of seconds to keep binary logs. This change was made to improve consistency and clarity in the configuration of the MySQL server.
阅读全文