开发者社区> 问答> 正文

mysql初始化了还是报错,怎么搞??报错

系统提示:

131217 11:07:09 mysqld_safe Starting mysqld daemon with databases from /data/mysql
131217 11:07:09 [Note] Plugin 'FEDERATED' is disabled.
/data/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
131217 11:07:09 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
131217 11:07:09 InnoDB: The InnoDB memory heap is disabled
131217 11:07:09 InnoDB: Mutexes and rw_locks use GCC atomic builtins
131217 11:07:09 InnoDB: Compressed tables use zlib 1.2.3
131217 11:07:09 InnoDB: Initializing buffer pool, size = 2.0G
131217 11:07:10 InnoDB: Completed initialization of buffer pool
131217 11:07:10 InnoDB: highest supported file format is Barracuda.
131217 11:07:10  InnoDB: Waiting for the background threads to start
131217 11:07:11 InnoDB: 1.1.8 started; log sequence number 1595675
131217 11:07:11 [Note] Recovering after a crash using mysql-bin
131217 11:07:11 [Note] Starting crash recovery...
131217 11:07:11 [Note] Crash recovery finished.
131217 11:07:11 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
131217 11:07:11 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
131217 11:07:11 [Note] Server socket created on IP: '0.0.0.0'.
131217 11:07:11 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
131217 11:07:11 mysqld_safe mysqld from pid file /data/mysql/tsaweb1.pid ended
131217 11:07:19 mysqld_safe Starting mysqld daemon with databases from /data/mysql
131217 11:07:19 [Note] Plugin 'FEDERATED' is disabled.
/data/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
131217 11:07:19 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
131217 11:07:19 InnoDB: The InnoDB memory heap is disabled
131217 11:07:19 InnoDB: Mutexes and rw_locks use GCC atomic builtins
131217 11:07:19 InnoDB: Compressed tables use zlib 1.2.3
131217 11:07:19 InnoDB: Initializing buffer pool, size = 2.0G
131217 11:07:20 InnoDB: Completed initialization of buffer pool
131217 11:07:20 InnoDB: highest supported file format is Barracuda.
131217 11:07:20  InnoDB: Waiting for the background threads to start
131217 11:07:21 InnoDB: 1.1.8 started; log sequence number 1595675
131217 11:07:21 [Note] Recovering after a crash using mysql-bin
131217 11:07:21 [Note] Starting crash recovery...
131217 11:07:21 [Note] Crash recovery finished.
131217 11:07:21 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
131217 11:07:21 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
131217 11:07:21 [Note] Server socket created on IP: '0.0.0.0'.
131217 11:07:21 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
131217 11:07:21 mysqld_safe mysqld from pid file /data/mysql/tsaweb1.pid ended


我谷歌了一下,说是初始化失败,但是我已经初始化了,命令是:

./mysql_install_db --basedir=/data/mysql --datadir=/data/mysql/data --user=mysql


而且在/data/mysql/data里面也有了相应的文件,但是启动还是不行。。。请问还应该修改什么参数。。谢谢!

附图:

展开
收起
爱吃鱼的程序员 2020-06-22 13:49:06 760 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    一、确认一下启动的datadir参数对不对:

    1.看一下mysql_safe进程的datadir的命令行参数;

    2.看一下/etc/my.cnf文件的datadir配置

    二、确认用户是否有数据库目录的权限

    2020-06-22 13:49:24
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
搭建电商项目架构连接MySQL 立即下载
搭建4层电商项目架构,实战连接MySQL 立即下载
PolarDB MySQL引擎重磅功能及产品能力盛大发布 立即下载

相关镜像