错误提示如下:
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_db 4 #/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 internal use. Used when building the MySQL system 8 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 if DNS does not 11 work. In that case, grant table entries that normally 12 use hostnames will use IP addresses. 13 --ldata=path The path to the MySQL data directory. 14 --rpm For internal use. This option is used by RPM files 15 during the MySQL installation process. 16 --skip-name-resolve Use IP addresses rather than hostnames when creating 17 grant table entries. This option can be useful if 18 your DNS does not work. 19 --srcdir=path For internal use. The directory under which 20 mysql_install_db looks for support files such as the 21 error message file and the file for popoulating the 22 help tables. 23 --user=user_name The login username to use for running mysqld. Files 24 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 using your current login name and files and 27 directories that it creates will be owned by you.