search

Home  >  Q&A  >  body text

mysql启动失败,但没有error信息,请问如何解决?

服务器环境:centos 6.4
启动代码:

# service mysqld start
Starting MySQL... ERROR! The server quit without updating PID file (/mnt/data/mysql/mysql.pid).

检查日志文件,也没有error:

131026 11:25:45 mysqld_safe Starting mysqld daemon with databases from /mnt/data/mysql
2013-10-26 11:25:46 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-10-26 11:25:46 13682 [Note] Plugin 'FEDERATED' is disabled.
2013-10-26 11:25:47 7feddd850720 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2013-10-26 11:25:47 13682 [Note] InnoDB: The InnoDB memory heap is disabled
2013-10-26 11:25:47 13682 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-10-26 11:25:47 13682 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-10-26 11:25:47 13682 [Note] InnoDB: CPU does not support crc32 instructions
2013-10-26 11:25:47 13682 [Note] InnoDB: Using Linux native AIO
2013-10-26 11:25:47 13682 [Note] InnoDB: Initializing buffer pool, size = 10.0M
2013-10-26 11:25:47 13682 [Note] InnoDB: Completed initialization of buffer pool
131026 11:25:47 mysqld_safe mysqld from pid file /mnt/data/mysql/mysql.pid ended

检查目录权限:

# ls -l /mnt/data/
总用量 656020
drwxr-xr-x 7 mysql mysql      4096 10月 26 11:24 mysql
大家讲道理大家讲道理2796 days ago835

reply all(4)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 11:16:50

    1. Please give the time relationship between the startup failure and the displayed log;
    2. Please check the general logs under /var/log, such as messages, daemon.log, etc.;
    3. Your server startup script seems to have been written or modified by yourself. Can you post it?

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 11:16:50

    ls -lZ checks the SELinux permissions of mysql datadir

    If it is a SELinux permission problem, you can use the following method to restore it. Assume that your datadir is /var/lib/mysql:

    semanage fcontext -a -t mysqld_db_t "/var/lib/mysql(/.*)?"
    restorecon -Rv /var/lib/mysql
    

    reply
    0
  • 黄舟

    黄舟2017-04-17 11:16:50

    I have encountered this problem several times. I'll write down what I did, but it may not necessarily be useful to you.

    1. Check whether the datadir, pid-file, and stocket paths in the /etc/my.cnf configuration are correct
    2. Check the permissions of mysql on the pid and socket directories
    3. If it doesn’t work, just put the pid and sock files in the /tmp directory

    I don’t know if it will be useful to you

    reply
    0
  • PHPz

    PHPz2017-04-17 11:16:50

    cat /var/log/messages

    It means there is not enough memory.
    top check which programs occupy the memory,
    or /etc/my.cnf and adjust the buffer pool
    or sync && echo 1 > /proc/sys/vm/drop_caches Release memory

    reply
    0
  • Cancelreply