mysql服务器没有启动 - mydomain.pid没有更新。
大家好,
我已经从rpms在centos 7中安装了MySQL: -
[root@kaljayi mysql]# rpm -qa MySQL*
MySQL-test-5.6.20-1.linux_glibc2.5.x86_64
MySQL-server-5.6.20-1.linux_glibc2.5.x86_64
MySQL-embedded-5.6.20-1.linux_glibc2.5.x86_64
MySQL-devel-5.6.20-1.linux_glibc2.5.x86_64
MySQL-shared-5.6.20-1.linux_glibc2.5.x86_64
MySQL-shared-compat-5.6.20-1.linux_glibc2.5.x86_64
MySQL-client-5.6.20-1.linux_glibc2.5.x86_64
然后发出命令后: -
[root@kaljayi mysql]# service mysql status
MySQL is not running, but lock file (/var/lock/subsys/mysql
[FAILED]
[root@kaljayi mysql]# service mysql start
Starting MySQL...The server quit without updating PID file (/var/run/mysql/sql.pid). [FAILED]
也可以通过这个命令: -
[root@kaljayi mysql]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Unable to connect to the server as root user, giving up.
Cleaning up...
[root@kaljayi mysql]# chown -R mysql:mysql /var/lib/mysql
[root@kaljayi mysql]# service mysql start
Starting MySQL...The server quit without updating PID file (/var/lib/mysql/
kaljayi.centos7.com.pid). [FAILED]
/etc/my.cnf文件是: -
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
port=3306
skip-external-locking
key_buffer_size=16K
pid-file=/var/lib/mysql/kaljayi.centos7.com.pid
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
#log-error=/var/log/mariadb/mariadb.log
#pid-file=/var/run/mariadb/mariadb.pid
log-error=/var/log/mysql/mysql.log
#pid-file=/var/run/mysql/mysql.pid
pid-file=/var/lib/mysql/kaljayi.centos7.com.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
如何启动它。