启用MySQL的Ubuntu 18.04中的bin记录掷误差



我试图做mysqldump,但是我有启用bin记录的错误

关于文档,我需要启用log-bin

所以我打开了sudo gedit /etc/mysql/mysql.conf.d/mysqld.cnf

并从log_bin的前部删除 #

log_bin     = /var/log/mysql/bin.log 

现在重新启动服务器

sudo /etc/init.d/mysql start
[....] Starting mysql (via systemctl): mysql.serviceJob for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.

所以我通过systemctl status mysql.service

检查

它给了我

mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2019-02-21 16:07:50 IST; 38s ago
  Process: 8612 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=0/SUCCESS)
  Process: 9463 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
 Main PID: 8614 (code=exited, status=0/SUCCESS)
Feb 21 16:07:50 frrrr-VirtualBox systemd[1]: mysql.service: Control process exited, code=exited status=1
Feb 21 16:07:50 frrrr-VirtualBox systemd[1]: mysql.service: Failed with result 'exit-code'.
Feb 21 16:07:50 frrrr-VirtualBox systemd[1]: Failed to start MySQL Community Server.
Feb 21 16:07:50 frrrr-VirtualBox systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Feb 21 16:07:50 frrrr-VirtualBox systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Feb 21 16:07:50 frrrr-VirtualBox systemd[1]: Stopped MySQL Community Server.
Feb 21 16:07:50 frrrr-VirtualBox systemd[1]: mysql.service: Start request repeated too quickly.
Feb 21 16:07:50 frrrr-VirtualBox systemd[1]: mysql.service: Failed with result 'exit-code'.
Feb 21 16:07:50 frrrr-VirtualBox systemd[1]: Failed to start MySQL Community Server.

好吧,我找到了解决方案

我们需要从Server-ID中解开(删除'#'),而其他如下

server-id       = 1
log_bin         = /var/log/mysql/bin.log
expire_logs_days    = 10
max_binlog_size   = 100M

然后重新启动mySQL服务,它将起作用。

最新更新