如何永久解决MySQL错误2002(HY000)
我希望大家都好。我的云服务器有问题,内存为2GB,硬盘为40GB,Wordpress网站每天的点击量约为1000-2000次。我的问题是MySQL总是崩溃,我唯一的选择就是重新启动服务器。我注意到日志没有启用,所以我启用了它们,下面是我发现的:如何永久解决MySQL错误2002(HY000),mysql,database,ubuntu,Mysql,Database,Ubuntu,我希望大家都好。我的云服务器有问题,内存为2GB,硬盘为40GB,Wordpress网站每天的点击量约为1000-2000次。我的问题是MySQL总是崩溃,我唯一的选择就是重新启动服务器。我注意到日志没有启用,所以我启用了它们,下面是我发现的: 150207 17:31:42 [Note] Plugin 'FEDERATED' is disabled. 150207 17:31:42 InnoDB: The InnoDB memory heap is disabled 150207 17:31:
150207 17:31:42 [Note] Plugin 'FEDERATED' is disabled.
150207 17:31:42 InnoDB: The InnoDB memory heap is disabled
150207 17:31:42 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150207 17:31:42 InnoDB: Compressed tables use zlib 1.2.3.4
150207 17:31:42 InnoDB: Initializing buffer pool, size = 1.2G
InnoDB: mmap(1285636096 bytes) failed; errno 12
150207 17:31:42 InnoDB: Completed initialization of buffer pool
150207 17:31:42 InnoDB: Fatal error: cannot allocate memory for the buffer pool
150207 17:31:42 [ERROR] Plugin 'InnoDB' init function returned error.
150207 17:31:42 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
150207 17:31:42 [ERROR] Unknown/unsupported storage engine: InnoDB
150207 17:31:42 [ERROR] Aborting
150207 17:31:42 [Note] /usr/sbin/mysqld: Shutdown complete
我猜这与内存分配或my.cnf文件中的某些设置有关。内容如下:
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
log_error = /var/log/mysql/mysql_error.log
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysql.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
datadir = /var/lib/mysql
thread_cache_size = 4
table_open_cache = 800
table_cache = 800
key_buffer = 32M
query_cache_type = 1
query_cache_size = 64M
query_cache_limit = 8M
innodb_buffer_pool_size = 1G
innodb_io_capacity = 2000
innodb_read_io_threads = 64
innodb_thread_concurrency = 0
innodb_write_io_threads = 64
log_error = /var/log/mysql/mysql_error.log
slow_query_log = 1
slow_query_log_file = /var/lib/mysql/ib_slow_log.log
任何帮助都将不胜感激
问候 我知道这很古老,但我想和大家分享一些简单的东西。我所需要做的就是将我的服务器RAM升级到4GB,并将我的密钥缓冲区翻倍,相应地查询缓存大小。从那时起,我的MySQL数据库就没有崩溃。谢谢大家! 你最好向HoboSapiens问好,让我来吧。非常感谢!