错误信息
Redirecting to /bin/systemctl restart mysqld.service
Job for mariadb.service failed. See 'systemctl status mariadb.service' and 'journalctl -xn' for details.
调试方法1, 使用mysql_install_db. 这样会报出很多错误信息
sudo mysql_install_db --user=mysql --datadir=/home/zhouitpro/mysql
调试试方法2, 检测
#/usr/libexec/mysqld --skip-grant --general-log &
[1] 13171
bash-4.2$ 140515 11:59:27 InnoDB: The InnoDB memory heap is disabled
140515 11:59:27 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140515 11:59:27 InnoDB: Compressed tables use zlib 1.2.8
140515 11:59:27 InnoDB: Using Linux native AIO
140515 11:59:27 InnoDB: Initializing buffer pool, size = 128.0M
140515 11:59:27 InnoDB: Completed initialization of buffer pool
140515 11:59:28 InnoDB: highest supported file format is Barracuda.
140515 11:59:30 InnoDB: Waiting for the background threads to start
140515 11:59:31 Percona XtraDB (http://www.percona.com) 5.5.37-MariaDB-34.0 started; log sequence number 20660071321
140515 11:59:31 [Note] Plugin 'FEEDBACK' is disabled.
140515 11:59:31 [Note] Server socket created on IP: '0.0.0.0'.
140515 11:59:31 [ERROR] mysqld: Can't create/write to file '/var/run/mariadb/mariadb.pid' (Errcode: 13)
140515 11:59:31 [ERROR] Can't start server: can't create PID file: Permission denied
错误大概出来了, 我没有权限.
chmod 777 /var/run/mariadb/
setenforce 0