CentOS
MYSQL
5.6不知道为什么,MYSQL总是莫名其妙的被关闭,然后网页提示
Connect Error (1045)Access denied for user 'root'@'172.0.0.1' (using password: YES)
下面是日志:
2016-01-09 20:01:02 13952 [Note] /usr/sbin/mysqld: Normal shutdown
2016-01-09 20:01:02 13952 [Note] Giving 0 client threads a chance to die gracefully
2016-01-09 20:01:02 13952 [Note] Shutting down slave threads
2016-01-09 20:01:02 13952 [Note] Forcefully disconnecting 0 remaining clients
2016-01-09 20:01:02 13952 [Note] Binlog end
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'partition'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'ARCHIVE'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'BLACKHOLE'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_METRICS'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_CMPMEM'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_CMP'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_LOCKS'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'INNODB_TRX'
2016-01-09 20:01:02 13952 [Note] Shutting down plugin 'InnoDB'
2016-01-09 20:01:02 13952 [Note] InnoDB: FTS optimize thread exiting.
2016-01-09 20:01:02 13952 [Note] InnoDB: Starting shutdown...
2016-01-09 20:01:04 13952 [Note] InnoDB: Shutdown completed; log sequence number 183335194
2016-01-09 20:01:04 13952 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-01-09 20:01:04 13952 [Note] Shutting down plugin 'CSV'
2016-01-09 20:01:04 13952 [Note] Shutting down plugin 'MEMORY'
2016-01-09 20:01:04 13952 [Note] Shutting down plugin 'MRG_MYISAM'
2016-01-09 20:01:04 13952 [Note] Shutting down plugin 'MyISAM'
2016-01-09 20:01:04 13952 [Note] Shutting down plugin 'sha256_password'
2016-01-09 20:01:04 13952 [Note] Shutting down plugin 'mysql_old_password'
2016-01-09 20:01:04 13952 [Note] Shutting down plugin 'mysql_native_password'
2016-01-09 20:01:04 13952 [Note] Shutting down plugin 'binlog'
2016-01-09 20:01:04 13952 [Note] /usr/sbin/mysqld: Shutdown complete
160109 20:01:04 mysqld_safe mysqld from pid file /data/lib/mysql/VM_45_56_centos.pid ended
160109 20:01:04 mysqld_safe Starting mysqld daemon with databases from /data/lib/mysql
2016-01-09 20:01:05 21981 [Note] Plugin 'FEDERATED' is disabled.
2016-01-09 20:01:05 21981 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-01-09 20:01:05 21981 [Note] InnoDB: The InnoDB memory heap is disabled
2016-01-09 20:01:05 21981 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-01-09 20:01:05 21981 [Note] InnoDB: Memory barrier is not used
2016-01-09 20:01:05 21981 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-01-09 20:01:05 21981 [Note] InnoDB: Using Linux native AIO
2016-01-09 20:01:05 21981 [Note] InnoDB: Not using CPU crc32 instructions
2016-01-09 20:01:05 21981 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-01-09 20:01:05 21981 [Note] InnoDB: Completed initialization of buffer pool
2016-01-09 20:01:05 21981 [Note] InnoDB: Highest supported file format is Barracuda.
2016-01-09 20:01:05 21981 [Note] InnoDB: 128 rollback segment(s) are active.
2016-01-09 20:01:05 21981 [Note] InnoDB: Waiting for purge to start
2016-01-09 20:01:05 21981 [Note] InnoDB: 5.6.21 started; log sequence number 183335194
2016-01-09 20:01:05 21981 [Note] Server hostname (bind-address): '*'; port: 3306
2016-01-09 20:01:05 21981 [Note] IPv6 is not available.
2016-01-09 20:01:05 21981 [Note] - '0.0.0.0' resolves to '0.0.0.0';
2016-01-09 20:01:05 21981 [Note] Server socket created on IP: '0.0.0.0'.
2016-01-09 20:01:05 21981 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.21' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
如果你用不到mysql日志或者说你不会看日志,那么我建议你把mysql的日志功能关掉,因为日志久而久之也会占用很大空间的,以lnmp一键安装包搭建的环境为例,关闭方法如下:
vim /etc/my.cnf 编辑mysql配置文件
找到 log-bin=mysql-bin 和 binlog_format=mixed 这两行并在行首分别加 # 以注释
保存并通过 /etc/init.d/mysql restart 命令重启 mysql 服务。
接下来可以把已有的mysql日志清一下,通过 cd /usr/local/mysql/var 命令进入mysql的日志目录
在这里插入图片描述
上图中,文件名称为mysql-bin.000001这样的都是日志文件了,统统删除,执行这个命令即可 rm -rf mysql-bin.*
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。