Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/55.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql在我的Vps上停止_Mysql_Wordpress_Vps - Fatal编程技术网

Mysql在我的Vps上停止

Mysql在我的Vps上停止,mysql,wordpress,vps,Mysql,Wordpress,Vps,您好,我的mysql有问题。我使用相同的配置迁移到了新的droplet。但是今天我在我的第一个站点遇到了这个问题: 在我的第二个站点中,有时它会将我重定向到wp admin/install,并在该页面上给出过多的错误指示。另一个问题是mysql停止时没有任何错误。在我重新启动mysql后,这些问题会在一段时间内得到解决,但之后仍然发生。我不知道这是什么原因。我需要重新启动mysql,用于解决这些问题,但这不是一个解决方案。大约12小时后,仍然会出现相同的问题 我在digital ocean 5

您好,我的mysql有问题。我使用相同的配置迁移到了新的droplet。但是今天我在我的第一个站点遇到了这个问题:

在我的第二个站点中,有时它会将我重定向到wp admin/install,并在该页面上给出过多的错误指示。另一个问题是mysql停止时没有任何错误。在我重新启动mysql后,这些问题会在一段时间内得到解决,但之后仍然发生。我不知道这是什么原因。我需要重新启动mysql,用于解决这些问题,但这不是一个解决方案。大约12小时后,仍然会出现相同的问题

我在digital ocean 5$plan的副总裁。1个cpu、512 mb ram、centos 6.5、apache、mysql、nginx、cpanel。其中只有2个wordpress站点。请帮助我永久解决此问题

etc/my.conf

[mysqld]
default-storage-engine=MyISAM
innodb_file_per_table=1
innodb_buffer_pool_size=60817408
max_allowed_packet=268435456
我的htop ss:


有一个插件需要INNODB。启用它。这个链接可以帮助

一个有半GB RAM的微型虚拟机根本不足以同时处理MySQL守护程序和web服务器。您需要在VM中获得更多RAM,或者拆分web服务器和MySQL服务器


许多每月5美元的共享托管计划都提供了一个单独的、共享的MySQL服务器,并且工作得很好。

如果你查阅服务器日志,你很可能会看到MySQL被OOM(内存不足)管理器杀死。这很可能是因为,在任何负载下,Apache都会启动子进程。您最好的短期解决方案可能是限制Apache工作人员的数量。最好的长期解决方案是在两个系统都有足够RAM的服务器上运行,以处理您遇到的负载。

除了php错误日志,您还有mysql错误日志要检查吗?看起来好像有什么东西正在停用innodb存储引擎,但是wordpress实际上并不需要innodb,所以我最好的猜测是Sabai框架正在过载您的mysql服务。您确定innodb引擎正在运行吗?您可以在phpmyadmin或控制台中使用
show engines
命令验证这一点。我不久前禁用并删除了该插件。但仍然出现错误。mysql出现故障。好的,show engines命令如何?您可以监视mysql中打开的连接数吗?这是mysql show engines输出,您没有运行innodb,因此您可能需要从my.conf中注释innodb参数。您确定sambai插件已正确禁用和删除吗?你们能确认它并没有留下自定义表吗?但在重新启动mysql之后,我的站点会恢复正常吗?这取决于那个插件,可能你们需要重新安装它。它应该是像sabaiframework一样的东西!对但我的另一个网站——没有安装sabai插件——也出现了错误。我在上面写道……我认为启用INNODB是值得的。你有一个例外,因为它,可能会出问题,没有它。在尝试复杂的解决方案之前,我宁愿尝试修复可见的异常。那么你是说我的RAM导致了这些问题?我不同意。在扩展到生产服务器之前,您应该在小型服务器中进行设计。此外,通过高估您的基础设施需求来解决软件瓶颈是个坏主意。我是linux新手。您能告诉我在哪里可以找到这些日志以及导致这些问题的原因吗?@mrblith
/var/log/messages
。谷歌“调优Apache”和“调优MySQL”作为起点。我添加了MySQL tunner报告。你能检查一下吗?
MySQL Version 5.5.37-cll x86_64

Uptime = 0 days 0 hrs 0 min 6 sec
Avg. qps = 2
Total Questions = 15
Threads Connected = 1

Warning: Server has not been running for at least 48hrs.
It may not be safe to use these recommendations

To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html
Visit http://www.mysql.com/products/enterprise/advisors.html
for info about MySQL's Enterprise Monitoring and Advisory Service

SLOW QUERIES
The slow query log is NOT enabled.
Current long_query_time = 10.000000 sec.
You have 0 out of 36 that take longer than 10.000000 sec. to complete
Your long_query_time seems to be fine

BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
See http://dev.mysql.com/doc/refman/5.5/en/point-in-time-recovery.html

WORKER THREADS
Current thread_cache_size = 0
Current threads_cached = 0
Current threads_per_sec = 1
Historic threads_per_sec = 3
Threads created per/sec are overrunning threads cached
You should raise thread_cache_size

MAX CONNECTIONS
Current max_connections = 300
Current threads_connected = 1
Historic max_used_connections = 1
The number of used connections is 0% of the configured maximum.
You are using less than 10% of your configured max_connections.
Lowering max_connections could help to avoid an over-allocation of memory
See "MEMORY USAGE" section to make sure you are not over-allocating

INNODB STATUS
Current InnoDB index space = 4 M
Current InnoDB data space = 3 M
Current InnoDB buffer pool free = 0 %
Current innodb_buffer_pool_size = 16 M
Depending on how much space your innodb indexes take up it may be safe
to increase this value to up to 2 / 3 of total system memory

MEMORY USAGE
Max Memory Ever Allocated : 42 M
Configured Max Per-thread Buffers : 825 M
Configured Max Global Buffers : 40 M
Configured Max Memory Limit : 865 M
Physical Memory : 490 M

Max memory limit exceeds 90% of physical memory

KEY BUFFER
No key reads?!
Seriously look into using some indexes
Current MyISAM index space = 393 K
Current key_buffer_size = 8 M
Key cache miss rate is 1 : 0
Key buffer free ratio = 81 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is supported but not enabled
Perhaps you should set the query_cache_size

SORT OPERATIONS
Current sort_buffer_size = 2 M
Current read_rnd_buffer_size = 256 K
No sort operations have been performed
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 132.00 K
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly

OPEN FILES LIMIT
Current open_files_limit = 4096 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine

TABLE CACHE
Current table_open_cache = 400 tables
Current table_definition_cache = 400 tables
You have a total of 234 tables
You have 234 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 16 M
Of 279 temp tables, 11% were created on disk
Created disk tmp tables ratio seems fine

TABLE SCANS
Current read_buffer_size = 128 K
Current table scan ratio = 10 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 0 : 294
Your table locking seems to be fine