chuzhaoqian 发表于 2015-7-27 13:15:09

wordpress Mysql 总是挂点想弄个mysql重启sh

网上找到了脚本


#!/bin/bash

result=`/usr/bin/mysqladmin ping`
expected='mysqld is alive'

if [[ "$result" != "$expected" ]]
then
echo "It's dead - restart mysql"

# email subject
SUBJECT=" - Attempting to restart service"

# Email To ?
EMAIL="info@endyourif.com"

# Email text/message
EMAILMESSAGE="/tmp/emailmessage.txt"
echo "$result was received"> $EMAILMESSAGE
echo "when we were expected $expected" >>$EMAILMESSAGE
# send an email using /bin/mail
mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE

sudo /etc/init.d/mysql restart
fi

但是没有发现/usr/bin/mysqladmin的存在军哥可以帮助一下伸手党么或者我需要安装什么服务呢

chuzhaoqian 发表于 2015-7-27 13:19:32

还有其他问题

我的服务器是阿里云 3M网速1G的内存lnmp1.2innodbmysql5.6在wordpress上传文件后总是卡死mysql我设置php最大上传是800Mnginx中设置了client_max_body_size 800m;    别且my.cnf中的loose-innodb- 我全部打开了


我是个新人确实不怎么会配置这个,希望能详细的指点下,
手残+脑残的病是治不好了……

chuzhaoqian 发表于 2015-7-27 17:22:27

这个是我的日志

/usr/local/mysql/var/iZ28vgksik8Z.err

licess 发表于 2015-7-27 21:06:43

/usr/local/mysql/bin/mysqladmin
找不到完全可以自己看官网文档或find 查找

InnoDB: mmap(17170432 bytes) failed; errno 12
2015-07-06 17:13:08 3244 InnoDB: Cannot allocate memory for the buffer pool
2015-07-06 17:13:08 3244 Plugin 'InnoDB' init function returned error.
2015-07-06 17:13:08 3244 Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2015-07-06 17:13:08 3244 Unknown/unsupported storage engine: InnoDB
2015-07-06 17:13:08 3244 Aborting
看日志有内存不足的一些信息,可以调整innodb_buffer_pool_size参数的值
或加大swap试试

chuzhaoqian 发表于 2015-7-27 21:45:01

灰常感谢军哥

:victory:   灰常灰常感谢军哥的权威指点
页: [1]
查看完整版本: wordpress Mysql 总是挂点想弄个mysql重启sh