打印

[MySQL] 如何重装mysql

如何重装mysql

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

TOP

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

LNMP付费问题排查/LNMP技术支持/Paypal信用卡代付/代购VPS,域名,软件等 QQ 503228080 旺旺 lzhenbao
军哥淘宝店铺
QQ/旺旺仅提供代购及付费代维/问题解决等服务,其他不回复!LNMP相关问题请在本论坛发帖,提问前先搜索,按https://bbs.vpser.net/thread-2555-1-1.html 要求反馈问题!

TOP

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

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

TOP

回复 2# 的帖子

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

ERROR! MySQL is not running, but PID file exists

180617 10:31:43 [Note] 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:43  InnoDB: Setting file /usr/local/mysql/var/ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
180617 10:31:43  InnoDB: 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:43  InnoDB: 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

TOP

配置文件 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

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

TOP

回复 4# 的帖子

日志和配置文件都不完整

LNMP付费问题排查/LNMP技术支持/Paypal信用卡代付/代购VPS,域名,软件等 QQ 503228080 旺旺 lzhenbao
军哥淘宝店铺
QQ/旺旺仅提供代购及付费代维/问题解决等服务,其他不回复!LNMP相关问题请在本论坛发帖,提问前先搜索,按https://bbs.vpser.net/thread-2555-1-1.html 要求反馈问题!

TOP

回复 6# 的帖子

配置文件

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

[mysqld]
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

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

TOP

回复 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:55  InnoDB: 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:56  InnoDB: Waiting for the background threads to start
180619 10:25:57 InnoDB: 5.5.56 started; log sequence number 14729671
180619 10:25:57 [Note] Recovering after a crash using mysql-bin
180619 10:25:57 [Note] Starting crash recovery...
180619 10:25:57 [Note] Crash recovery finished.
180619 10:25:57 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
180619 10:25:57 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
180619 10:25:57 [Note] Server socket created on IP: '0.0.0.0'.
180619 10:25:57 [Warning] 'user' entry 'a1@%' has both a password and an authentication plugin specified. The password will be ignored.
180619 10:25:57 [Warning] 'user' entry 'a2@%' has both a password and an authentication plugin specified. The password will be ignored.
180619 10:25:57 [Warning] 'user' entry 'a3@%' has both a password and an authentication plugin specified. The password will be ignored.
180619 10:25:57 [Warning] 'user' entry 'a4@%' has both a password and an authentication plugin specified. The password will be ignored.
180619 10:25:57 [Note] Event Scheduler: Loaded 0 events
180619 10:25:57 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.56-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution

TOP

回复 7# 的帖子

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

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

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

180617 10:31:46 [Note] 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:46  InnoDB: Waiting for the background threads to start
180617 10:31:47 InnoDB: 5.5.56 started; log sequence number 1595675
180617 10:31:47 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
180617 10:31:47 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
180617 10:31:47 [Note] Server socket created on IP: '0.0.0.0'.
180617 10:31:47 [Note] Event Scheduler: Loaded 0 events
180617 10:31:47 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.56-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
180617 10:31:48 [Note] /usr/local/mysql/bin/mysqld: Normal shutdown

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

180617 10:31:50 [Note] 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:50  InnoDB: Waiting for the background threads to start
180617 10:31:51 InnoDB: 5.5.56 started; log sequence number 1595685
180617 10:31:51 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
180617 10:31:51 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
180617 10:31:51 [Note] Server socket created on IP: '0.0.0.0'.
180617 10:31:51 [Note] Event Scheduler: Loaded 0 events
180617 10:31:51 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.56-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
180617 10:31:52 [Note] /usr/local/mysql/bin/mysqld: Normal shutdown

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

180617 10:31:53 [Note] 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:53  InnoDB: Waiting for the background threads to start
180617 10:31:54 InnoDB: 5.5.56 started; log sequence number 1595685
180617 10:31:54 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
180617 10:31:54 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
180617 10:31:54 [Note] Server socket created on IP: '0.0.0.0'.
180617 10:31:54 [Note] Event Scheduler: Loaded 0 events
180617 10:31:54 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.56-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
180618  0:04:06 [Warning] IP address '47.96.254.10' could not be resolved: Name or service not known
180618  2:01:09 [Warning] IP address '119.23.138.247' could not be resolved: Name or service not known
180618  3:14:18 [Warning] IP address '47.100.64.9' could not be resolved: Name or service not known

TOP

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

LNMP付费问题排查/LNMP技术支持/Paypal信用卡代付/代购VPS,域名,软件等 QQ 503228080 旺旺 lzhenbao
军哥淘宝店铺
QQ/旺旺仅提供代购及付费代维/问题解决等服务,其他不回复!LNMP相关问题请在本论坛发帖,提问前先搜索,按https://bbs.vpser.net/thread-2555-1-1.html 要求反馈问题!

TOP

回复 10# 的帖子

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

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

感谢军哥的lnmp一键安装包,很好用!

TOP