错误提示如下:
150815 20:24:40 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
150815 20:26:07 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
150815 20:26:07 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
解决方法:
mysql_install_db --user=mysql #进行数据库的初始化
以下是此命令的用法:
1 mysql_install_db说明2 当MySQL的系统库(mysql系统库)发生故障或需要新加一个mysql实例时,需要初始化mysql数据库。3 需要使用的命令:/usr/local/mysql/bin/mysql_install_db4 #/usr/local/mysql/bin/mysql_install_db --help 可以查看帮助信息如下5 Usage: /usr/local/mysql/bin/mysql_install_db [OPTIONS]6 --basedir=path The path to the MySQL installation directory.7 --cross-bootstrap For internaluse. Used when building the MySQL system8 tables on a different host than the target.9 --datadir=path The path to the MySQL data directory.10 --force Causes mysql_install_db to run even ifDNS does not11 work. In that case, grant table entries that normally12 use hostnames will use IP addresses.13 --ldata=path The path to the MySQL data directory.14 --rpm For internal use. This option isused by RPM files15 during the MySQL installation process.16 --skip-name-resolve Use IP addresses rather than hostnames when creating17 grant table entries. This option can be useful if
18 your DNS does not work.19 --srcdir=path For internaluse. The directory under which20 mysql_install_db looks for support files such asthe21 error message file and the file forpopoulating the22 help tables.23 --user=user_name The login username to use forrunning mysqld. Files24 and directories created by mysqld will be owned by this
25 user. You must be root to use this option. By default
26 mysqld runs usingyour current login name and files and27 directories that it creates will be owned by you.