mysql_5.7.25启用binlog后mysql无法启动

mysql> select version();
±----------+
| version() |
±----------+
| 5.7.25 |
±----------+
1 row in set (0.00 sec)

mysql> show variables like’%log_bin%’;
±--------------------------------±------+
| Variable_name | Value |
±--------------------------------±------+
| log_bin | OFF |
| log_bin_basename | |
| log_bin_index | |
| log_bin_trust_function_creators | OFF |
| log_bin_use_v1_row_events | OFF |
| sql_log_bin | ON |
±--------------------------------±------+
6 rows in set (0.01 sec)

#修改/etc/my.cnf 启动binlog
[root@linux_64 mysqldata]# vi /etc/my.cnf

  1 # For advice on how to change settings please see
  2 # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
  3 [client]
  4 socket=/mysqldata/mysql/mysql.sock
  5 
  6 [mysqld]
  7 #
  8 # Remove leading # and set to the amount of RAM for the most important data
  9 # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
 10 # innodb_buffer_pool_size = 128M
 11 #
 12 # Remove leading # to turn on a very important data integrity option: logging
 13 # changes to the binary log between backups.
 14 # log_bin
 15 #
 16 # Remove leading # to set options mainly useful for reporting servers.
 17 # The server defaults are faster for transactions and fast SELECTs.
 18 # Adjust sizes as needed, experiment to find the optimal values.
 19 # join_buffer_size = 128M
 20 # sort_buffer_size = 2M
 21 # read_rnd_buffer_size = 2M
 22 datadir=/mysqldata/mysql
 23 socket=/mysqldata/mysql/mysql.sock
 24 log_bin=/mysqldata/log_bin.00001				**//添加**
 25 
 26 # Disabling symbolic-links is recommended to prevent assorted security risks
 27 symbolic-links=0
 28 
 29 log-error=/var/log/mysqld.log
 30 pid-file=/var/run/mysqld/mysqld.pid

#启动mysql
[root@linux_64 mysqldata]# service mysqld start
MySQL Daemon failed to start.
Starting mysqld: [FAILED]

#查看mysql错误日志并没有任何报错
2019-05-28T05:59:35.664967Z 0 [Note] InnoDB: Starting shutdown…
2019-05-28T05:59:35.765738Z 0 [Note] InnoDB: Dumping buffer pool(s) to /mysqldata/mysql/ib_buffer_pool
2019-05-28T05:59:35.766007Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 190528 13:59:35
2019-05-28T05:59:37.295237Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2540222
2019-05-28T05:59:37.297884Z 0 [Note] InnoDB: Removed temporary tablespace data file: “ibtmp1”
2019-05-28T05:59:37.297911Z 0 [Note] Shutting down plugin ‘MEMORY’
2019-05-28T05:59:37.297923Z 0 [Note] Shutting down plugin ‘PERFORMANCE_SCHEMA’
2019-05-28T05:59:37.297978Z 0 [Note] Shutting down plugin ‘MRG_MYISAM’
2019-05-28T05:59:37.297990Z 0 [Note] Shutting down plugin ‘sha256_password’
2019-05-28T05:59:37.297998Z 0 [Note] Shutting down plugin ‘mysql_native_password’
2019-05-28T05:59:37.298291Z 0 [Note] Shutting down plugin ‘binlog’
2019-05-28T05:59:37.298672Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

#重新修改/etc/my.cnf文件,添加server-id
[root@linux_64 mysqldata]# vi /etc/my.cnf

  1 # For advice on how to change settings please see
  2 # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
  3 [client]
  4 socket=/mysqldata/mysql/mysql.sock
  5 
  6 [mysqld]
  7 #
  8 # Remove leading # and set to the amount of RAM for the most important data
  9 # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
 10 # innodb_buffer_pool_size = 128M
 11 #
 12 # Remove leading # to turn on a very important data integrity option: logging
 13 # changes to the binary log between backups.
 14 # log_bin
 15 #
 16 # Remove leading # to set options mainly useful for reporting servers.
 17 # The server defaults are faster for transactions and fast SELECTs.
 18 # Adjust sizes as needed, experiment to find the optimal values.
 19 # join_buffer_size = 128M
 20 # sort_buffer_size = 2M
 21 # read_rnd_buffer_size = 2M
 22 datadir=/mysqldata/mysql
 23 socket=/mysqldata/mysql/mysql.sock
 24 server-id = 1							**//添加**
 25 log_bin=/mysqldata/log_bin.00001
 26 
 27 # Disabling symbolic-links is recommended to prevent assorted security risks
 28 symbolic-links=0
 29 
 30 log-error=/var/log/mysqld.log
 31 pid-file=/var/run/mysqld/mysqld.pid

#再次启动mysql

[root@linux_64 mysqldata]# service mysqld start
Starting mysqld: [ OK ]

[root@linux_64 ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.25-log MySQL Community Server (GPL)

Copyright © 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> select version();
±-----------+
| version() |
±-----------+
| 5.7.25-log |
±-----------+
1 row in set (0.00 sec)

mysql> show variables like’%log_bin%’;
±--------------------------------±-------------------------+
| Variable_name | Value |
±--------------------------------±-------------------------+
| log_bin | ON |
| log_bin_basename | /mysqldata/log_bin |
| log_bin_index | /mysqldata/log_bin.index |
| log_bin_trust_function_creators | OFF |
| log_bin_use_v1_row_events | OFF |
| sql_log_bin | ON |
±--------------------------------±-------------------------+
6 rows in set (0.00 sec)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值