[[email protected] download]# service mysqld start
Redirecting To/bin/systemctl start Mysqld.service
Job for Mysqld.service failed because a timeout is exceeded. See "Systemctl Status Mysqld.service" and "Journalctl-xe" for details.
Resolves a problem with the installation package, and then MySQL does not come up after installation
more /etc/my.cnf |grep -v ^#
[Email protected] ~]# more/etc/my.cnf |grep-v ^#
[Mysqld]
Datadir=/var/lib/mysql
Socket=/var/lib/mysql/mysql.sock
Symbolic-links=0
Sql_mode=no_engine_substitution,strict_trans_tables
[Mysqld_safe]
Log-error=/var/log/mysqld.log
Pid-file=/var/run/mysqld/mysqld.pid
Configuration looks normal
systemctl status -l mysqld
Found the error log/var/log/mysqld.log
CGroup:/system.slice/mysqld.service
├─5472/bin/sh/usr/bin/mysqld_safe
└─5638/usr/sbin/mysqld--basedir=/usr--datadir=/var/lib/mysql--plugin-dir=/usr/lib64/mysql/plugin--log-error=/ Var/log/mysqld.log--pid-file=/var/run/mysqld/mysqld.pid--socket=/var/lib/mysql/mysql.sock
Nov 17:21:49 localhost.localdomain systemd[1]: Mysqld.service holdoff time over, scheduling restart.
Nov 17:21:49 Localhost.localdomain systemd[1]: Starting MySQL Community Server ...
Nov 17:21:49 localhost.localdomain mysqld_safe[5472]: 161104 17:21:49 mysqld_safe Logging to '/var/log/mysqld.log '.
Nov 17:21:50 localhost.localdomain mysqld_safe[5472]: 161104 17:21:50 mysqld_safe starting mysqld daemon with databases From/var/lib/mysql
Nov 17:21:50 localhost.localdomain systemd[1]: Started MySQL Community Server.
Tail down the log and search for the next error.
Fatal Error:can ' t open and Lock Privilege tables:table ' mysql.host ' doesn ' t exist
Initialize database with script, invalid
scripts/mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysql--ldata=/var/lib/ Mysql
Insufficient permissions, then added 2 directory permissions
chown-r mysql/var/lib/mysql
chgrp -R mysql /var/lib/mysql
Finally came in.
[[email protected] ~]# MySQL
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 3
Server version:5.6.34 MySQL Community Server (GPL)
Copyright (c), Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
Mysql>
This article is from the "Hao (pcdog) blog" blog, make sure to keep this source http://433266.blog.51cto.com/423266/1869687
Fatal Error:can ' t open and Lock Privilege tables:table ' mysql.host ' doesn ' t exist