Fatal Error:can ' t open and Lock Privilege tables:table ' mysql.host ' doesn ' t exist

Source: Internet
Author: User

[[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 mysqldFound 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.