开发者社区 问答 正文

mysql运行时报错,“Can't open the mysql.plugin ?400报错

mysql运行时报错,“Can't open the mysql.plugin table”? 400 报错

121031 14:14:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql /usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist 121031 14:14:12 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 121031 14:14:12  InnoDB: Initializing buffer pool, size = 8.0M 121031 14:14:12  InnoDB: Completed initialization of buffer pool 121031 14:14:12  InnoDB: Started; log sequence number 0 43655 121031 14:14:12 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist 121031 14:14:12 [ERROR] Column count of mysql.db is wrong. Expected 22, found 20. Created with MySQL 50095, now running 50158. Please use mysql_upgrade to fix this error. 121031 14:14:12 [ERROR] mysql.user has no Event_priv column at position 29 121031 14:14:12 [ERROR] Cannot open mysql.event 121031 14:14:12 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler. 121031 14:14:12 [Note] /usr/libexec/mysqld: ready for connections. Version: '5.1.58'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL) by Utter Ramblings

我是个mysql新手,在网上找了很久

解决方法是:在运行初始化权限表的时候使用增加参数--datadir ,命令格式为: shell> ..../mysql_install_db --user=mysql --datadir=/usr/local/mysql/var


但是我运行的出错。请大家帮帮小弟,谢谢啦

展开
收起
爱吃鱼的程序员 2020-06-03 15:12:31 728 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    my.cnf配置文件发一下,你是怎么安装mysql的

    最简单的, yum -y install mysql*

    ######帮帮我~~~~~大神######

    引用来自“葱油拌面”的答案

    my.cnf配置文件发一下,你是怎么安装mysql的

    最简单的, yum -y install mysql*

    对,我就是用 yum -y install mysql*安装的。

    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    # Disabling symbolic-links is recommended to prevent assorted security risks
    symbolic-links=0
    
    # To enable the InnoDB Plugin, uncomment the 2 next lines
    #ignore-builtin-innodb
    #plugin-load=innodb=ha_innodb_plugin.so
    
    # To enable InnoDB-related INFORMATION_SCHEMA tables
    # Join the following options to above directive
      ;innodb_trx=ha_innodb_plugin.so
      ;innodb_locks=ha_innodb_plugin.so
      ;innodb_cmp=ha_innodb_plugin.so
      ;innodb_cmp_reset=ha_innodb_plugin.so
      ;innodb_cmpmem=ha_innodb_plugin.so
      ;innodb_cmpmem_reset=ha_innodb_plugin.so
    
    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid

    ######

    请问解决了吗?我的出现同样的问题,也是找了很久没找到原因。

    140524 03:15:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    140524  3:15:57 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    140524  3:15:57  InnoDB: Initializing buffer pool, size = 8.0M
    140524  3:15:57  InnoDB: Completed initialization of buffer pool
    140524  3:15:57  InnoDB: Started; log sequence number 0 44233
    140524  3:15:57 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
    140524 03:15:57 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended


    ######mysql_install_db --user=mysql --ldata=/var/lib/mysql/ 用一条语句就解决了,不知道什么原因。
    2020-06-03 16:47:17
    赞同 展开评论