muntime 发表于 2018-6-15 18:46:35

如何重装mysql

使用一年多,最近Mysql挂掉,查看日志,Plugin 'FEDERATED' is disabled.,按网上搜索的方法,尝试在 添加,tmpdir和federated参数无果,后经尝试多个方法后mysql再也无法启动,可能误删除了其中的文件,所以想重新安装Mysql,数据有备份!

licess 发表于 2018-6-16 18:16:23

没有mysql日志不清楚mysql为什么挂掉
如果只是想删除后重新安装,可以先搜索:卸载mysql 按教程卸载
然后 ./install.sh db 就可以了

muntime 发表于 2018-6-17 18:41:42

感谢,已经成功卸载并重新安装成功!

感谢,已经成功卸载并重新安装成功!

muntime 发表于 2018-6-19 10:19:26

回复 2# 的帖子

重装mysql之后依旧会挂掉,能麻烦看一下是什么原因吗

ERROR! MySQL is not running, but PID file exists

180617 10:31:43 Plugin 'FEDERATED' is disabled.
180617 10:31:43 InnoDB: The InnoDB memory heap is disabled
180617 10:31:43 InnoDB: Mutexes and rw_locks use GCC atomic builtins
180617 10:31:43 InnoDB: Compressed tables use zlib 1.2.7
180617 10:31:43 InnoDB: Initializing buffer pool, size = 16.0M
180617 10:31:43 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file /usr/local/mysql/var/ibdata1 did not exist:
InnoDB: a new database to be created!
180617 10:31:43InnoDB: Setting file /usr/local/mysql/var/ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
180617 10:31:43InnoDB: Log file /usr/local/mysql/var/ib_logfile0 did not exist: new to be created
InnoDB: Setting log file /usr/local/mysql/var/ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
180617 10:31:43InnoDB: Log file /usr/local/mysql/var/ib_logfile1 did not exist: new to be created
InnoDB: Setting log file /usr/local/mysql/var/ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables

muntime 发表于 2018-6-19 10:21:00

配置文件 my.cnf


innodb_log_group_home_dir = /usr/local/mysql/var
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50


quick
max_allowed_packet = 16M


no-auto-rehash


key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M


interactive-timeout

licess 发表于 2018-6-19 14:18:37

回复 4# 的帖子

日志和配置文件都不完整

muntime 发表于 2018-6-19 15:26:19

回复 6# 的帖子

配置文件


#password       = your_password
port            = 3306
socket          = /tmp/mysql.sock


port            = 3306
socket          = /tmp/mysql.sock
datadir = /usr/local/mysql/var
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
thread_cache_size = 8
query_cache_size = 8M
tmp_table_size = 16M

#skip-networking
max_connections = 500
max_connect_errors = 100
open_files_limit = 65535

log-bin=mysql-bin
binlog_format=mixed
server-id       = 1
expire_logs_days = 10

default_storage_engine = InnoDB
innodb_file_per_table = 1
innodb_data_home_dir = /usr/local/mysql/var
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /usr/local/mysql/var
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50


quick
max_allowed_packet = 16M


no-auto-rehash


key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M


interactive-timeout

muntime 发表于 2018-6-19 15:31:49

回复 6# 的帖子

错误日志

180619 10:25:55 InnoDB: The InnoDB memory heap is disabled
180619 10:25:55 InnoDB: Mutexes and rw_locks use GCC atomic builtins
180619 10:25:55 InnoDB: Compressed tables use zlib 1.2.7
180619 10:25:55 InnoDB: Initializing buffer pool, size = 16.0M
180619 10:25:55 InnoDB: Completed initialization of buffer pool
180619 10:25:55 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
180619 10:25:55InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Last MySQL binlog file position 0 11858272, file name ./mysql-bin.000006
180619 10:25:56InnoDB: Waiting for the background threads to start
180619 10:25:57 InnoDB: 5.5.56 started; log sequence number 14729671
180619 10:25:57 Recovering after a crash using mysql-bin
180619 10:25:57 Starting crash recovery...
180619 10:25:57 Crash recovery finished.
180619 10:25:57 Server hostname (bind-address): '0.0.0.0'; port: 3306
180619 10:25:57    - '0.0.0.0' resolves to '0.0.0.0';
180619 10:25:57 Server socket created on IP: '0.0.0.0'.
180619 10:25:57 'user' entry 'a1@%' has both a password and an authentication plugin specified. The password will be ignored.
180619 10:25:57 'user' entry 'a2@%' has both a password and an authentication plugin specified. The password will be ignored.
180619 10:25:57 'user' entry 'a3@%' has both a password and an authentication plugin specified. The password will be ignored.
180619 10:25:57 'user' entry 'a4@%' has both a password and an authentication plugin specified. The password will be ignored.
180619 10:25:57 Event Scheduler: Loaded 0 events
180619 10:25:57 /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.56-log'socket: '/tmp/mysql.sock'port: 3306Source distribution

muntime 发表于 2018-6-19 15:35:04

回复 7# 的帖子

17号重新安装后那天的日志

InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
180617 10:31:44InnoDB: Waiting for the background threads to start
180617 10:31:45 InnoDB: 5.5.56 started; log sequence number 0
180617 10:31:45 Server hostname (bind-address): '0.0.0.0'; port: 3306
180617 10:31:45    - '0.0.0.0' resolves to '0.0.0.0';
180617 10:31:45 Server socket created on IP: '0.0.0.0'.
180617 10:31:45 Event Scheduler: Loaded 0 events
180617 10:31:45 /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.56-log'socket: '/tmp/mysql.sock'port: 3306Source distribution
180617 10:31:45 /usr/local/mysql/bin/mysqld: Normal shutdown

180617 10:31:45 Event Scheduler: Purging the queue. 0 events
180617 10:31:45InnoDB: Starting shutdown...
180617 10:31:45InnoDB: Shutdown completed; log sequence number 1595675
180617 10:31:45 /usr/local/mysql/bin/mysqld: Shutdown complete

180617 10:31:46 Plugin 'FEDERATED' is disabled.
180617 10:31:46 InnoDB: The InnoDB memory heap is disabled
180617 10:31:46 InnoDB: Mutexes and rw_locks use GCC atomic builtins
180617 10:31:46 InnoDB: Compressed tables use zlib 1.2.7
180617 10:31:46 InnoDB: Initializing buffer pool, size = 16.0M
180617 10:31:46 InnoDB: Completed initialization of buffer pool
180617 10:31:46 InnoDB: highest supported file format is Barracuda.
180617 10:31:46InnoDB: Waiting for the background threads to start
180617 10:31:47 InnoDB: 5.5.56 started; log sequence number 1595675
180617 10:31:47 Server hostname (bind-address): '0.0.0.0'; port: 3306
180617 10:31:47    - '0.0.0.0' resolves to '0.0.0.0';
180617 10:31:47 Server socket created on IP: '0.0.0.0'.
180617 10:31:47 Event Scheduler: Loaded 0 events
180617 10:31:47 /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.56-log'socket: '/tmp/mysql.sock'port: 3306Source distribution
180617 10:31:48 /usr/local/mysql/bin/mysqld: Normal shutdown

180617 10:31:48 Event Scheduler: Purging the queue. 0 events
180617 10:31:48InnoDB: Starting shutdown...
180617 10:31:49InnoDB: Shutdown completed; log sequence number 1595685
180617 10:31:49 /usr/local/mysql/bin/mysqld: Shutdown complete

180617 10:31:50 Plugin 'FEDERATED' is disabled.
180617 10:31:50 InnoDB: The InnoDB memory heap is disabled
180617 10:31:50 InnoDB: Mutexes and rw_locks use GCC atomic builtins
180617 10:31:50 InnoDB: Compressed tables use zlib 1.2.7
180617 10:31:50 InnoDB: Initializing buffer pool, size = 16.0M
180617 10:31:50 InnoDB: Completed initialization of buffer pool
180617 10:31:50 InnoDB: highest supported file format is Barracuda.
180617 10:31:50InnoDB: Waiting for the background threads to start
180617 10:31:51 InnoDB: 5.5.56 started; log sequence number 1595685
180617 10:31:51 Server hostname (bind-address): '0.0.0.0'; port: 3306
180617 10:31:51    - '0.0.0.0' resolves to '0.0.0.0';
180617 10:31:51 Server socket created on IP: '0.0.0.0'.
180617 10:31:51 Event Scheduler: Loaded 0 events
180617 10:31:51 /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.56-log'socket: '/tmp/mysql.sock'port: 3306Source distribution
180617 10:31:52 /usr/local/mysql/bin/mysqld: Normal shutdown

180617 10:31:52 Event Scheduler: Purging the queue. 0 events
180617 10:31:52InnoDB: Starting shutdown...
180617 10:31:52InnoDB: Shutdown completed; log sequence number 1595685
180617 10:31:52 /usr/local/mysql/bin/mysqld: Shutdown complete

180617 10:31:53 Plugin 'FEDERATED' is disabled.
180617 10:31:53 InnoDB: The InnoDB memory heap is disabled
180617 10:31:53 InnoDB: Mutexes and rw_locks use GCC atomic builtins
180617 10:31:53 InnoDB: Compressed tables use zlib 1.2.7
180617 10:31:53 InnoDB: Initializing buffer pool, size = 16.0M
180617 10:31:53 InnoDB: Completed initialization of buffer pool
180617 10:31:53 InnoDB: highest supported file format is Barracuda.
180617 10:31:53InnoDB: Waiting for the background threads to start
180617 10:31:54 InnoDB: 5.5.56 started; log sequence number 1595685
180617 10:31:54 Server hostname (bind-address): '0.0.0.0'; port: 3306
180617 10:31:54    - '0.0.0.0' resolves to '0.0.0.0';
180617 10:31:54 Server socket created on IP: '0.0.0.0'.
180617 10:31:54 Event Scheduler: Loaded 0 events
180617 10:31:54 /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.56-log'socket: '/tmp/mysql.sock'port: 3306Source distribution
1806180:04:06 IP address '47.96.254.10' could not be resolved: Name or service not known
1806182:01:09 IP address '119.23.138.247' could not be resolved: Name or service not known
1806183:14:18 IP address '47.100.64.9' could not be resolved: Name or service not known

licess 发表于 2018-6-19 17:04:33

提供的日志中并没有错误信息
Plugin 'FEDERATED' is disabled. 也不算是报错,也不是问题,这个本来就没开

muntime 发表于 2018-6-22 12:01:23

回复 10# 的帖子

网上搜索到的方法,
rm /var/lock/subsys/mysql

然后重启Mysql,稳定运行3天了,mysql再也没有挂掉

感谢军哥的lnmp一键安装包,很好用!
页: [1]
查看完整版本: 如何重装mysql