[root@localhost support-files]# /etc/init.d/mysqld start
Starting MySQL.201228 11:39:46 mysqld_safe error: log-error set to ‘/var/log/mariadb/mariadb.log’, however file don’t exists. Create writable for user ‘mysql’.
ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).
首先来看第一个错误:
Starting MySQL.201228 11:39:46 mysqld_safe error: log-error set to '/var/log/mariadb/mariadb.log', however file don't exists. Create writable for user 'mysql'.
这个错误提示文件不存在,需要创建可写用户mysql
可是安装时已经创建了mysql,又id mysql重新确认了下,用户没问题
检查这个文件确实不存在,于是手动创建了文件试试
[root@localhost mysql]# echo "" > /var/log/mariadb/mariadb.log
[root@localhost mysql]# chown -R mysql. /var/log/mariadb/mariadb.log
[root@localhost mysql]# /etc/init.d/mysqld start
Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).
创建完log并给予权限后重新mysql发现第一问题解决了,说明第一个问题就是没有找到文件导致,手动创建搞定。
下边就来继续看第二个问题:
Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).
这个问题想看看日志怎末提示,结果发现日志中任何信息,感觉自己安装了个假mysql。
从网上在找的方法都试了试,有的说是权限问题检查没有问题,有的说是内存或者硬盘(好奇会跟这两个有关系吗)不过也都查看了没问题
还在网上试了几种别的方法都不管用,启动还是回报这个错误
后来看了一篇文章(http://www.3qphp.com/mysql/sqlquest/2859.html)里面讲的是my.cnf配置文件的问题
作者的配置文件编译安装时文件目录不正确导致的,回头再来看我的配置文件好像少点东西。
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 256M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
thread_concurrency = 8
里面没有配置数据目录,于是兴奋的添加数据目录datadir=/data/mysql重新尝试后发现
[root@localhost mysql55]# /etc/init.d/mysqld start
Starting MySQL... SUCCESS!
最后大大的SUCCESS出来了。启动成功问题搞懂