mysql 无论如何都启动不了

2020-09-08 01:38:49 +08:00
 monkeydev
200907 17:36:42 [Note] Plugin 'FEDERATED' is disabled.
/www/server/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
200907 17:36:42 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
200907 17:36:42 InnoDB: The InnoDB memory heap is disabled
200907 17:36:42 InnoDB: Mutexes and rw_locks use GCC atomic builtins
200907 17:36:42 InnoDB: Compressed tables use zlib 1.2.11
200907 17:36:42 InnoDB: Initializing buffer pool, size = 256.0M
200907 17:36:42 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file /www/server/data/ibdata1 did not exist:
InnoDB: a new database to be created!
200907 17:36:42 InnoDB: Setting file /www/server/data/ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
200907 17:36:42 InnoDB: Log file /www/server/data/ib_logfile0 did not exist: new to be created
InnoDB: Setting log file /www/server/data/ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
200907 17:36:42 InnoDB: Log file /www/server/data/ib_logfile1 did not exist: new to be created
InnoDB: Setting log file /www/server/data/ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
200907 17:36:42 InnoDB: Waiting for the background threads to start
200907 17:36:43 InnoDB: 5.5.62 started; log sequence number 0
200907 17:36:43 [Note] Recovering after a crash using mysql-bin
200907 17:36:43 [Note] Starting crash recovery...
200907 17:36:43 [Note] Crash recovery finished.
200907 17:36:43 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
200907 17:36:43 [Note] - '0.0.0.0' resolves to '0.0.0.0';
200907 17:36:43 [Note] Server socket created on IP: '0.0.0.0'.
200907 17:36:43 [Warning] Insecure configuration for --pid-file: Location '/www/server/data' in the path is accessible to all OS users. Consider choosing a different directory.
200907 17:36:43 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

不知道这是什么情况啊
google 里面的都试过了
还是不行 啊
1328 次点击
所在节点    问与答
10 条回复
wangsongyan
2020-09-08 05:41:10 +08:00
Please run mysql_upgrade to create it.
singerll
2020-09-08 07:23:21 +08:00
mysql_upgrade 好像是只有数据库启动后才能执行吧,把 plugin,host 表从别的库拷过来扔到数据目录,权限改正确,启动一下试试。
singerll
2020-09-08 07:26:49 +08:00
再不行就把 mysql 这个库的所有表都拷过来。记得好像是个 bug,数据目录本身是存在这个表的,但就是读不到。。。。启动成功后 drop 掉,再执行建表语句创建( mysql 安装文件中有这几个语句)
vicnicLight007
2020-09-08 08:39:01 +08:00
服务器内存够不够。以前碰到这种,用的 docker
monkeydev
2020-09-08 08:39:08 +08:00
root@ubuntu:~# mysql_upgrade

Command 'mysql_upgrade' not found, but can be installed with:

apt install mysql-server-core-5.7
apt install mariadb-server-core-10.1
apt install percona-server-server-5.6
apt install percona-xtradb-cluster-server-5.7

@wangsongyan
@singerll
@singerll
dzdh
2020-09-08 08:53:29 +08:00
200907 17:36:43 [Warning] Insecure configuration for --pid-file: Location '/www/server/data' in the path is accessible to all OS users. Consider choosing a different directory.

--

--pid-file 制定的文件的路径中的位置是所有操作系统用户都可以访问的。考虑选择一个不同的目录
nutting
2020-09-08 08:55:13 +08:00
文件权限问题方向看看
steptodream
2020-09-08 08:58:27 +08:00
@monkeydev 从错误的路径看 看样子你根本不是用 apt-get 安装的数据库 你很可能用的一键包啥的


不是 apt-get 安装的 mysql 的命令很可能不在默认 PATH 里 你可以试试 /www/server/mysql/bin/mysql_upgrade
594duck
2020-09-08 09:08:33 +08:00
加一个 skip-grant-tables 重启一下,先把 mysql 启动起来,再把数据备份了,再重新初始化一下 mysql
monkeydev
2020-09-08 09:35:29 +08:00
@steptodream
root@ubuntu:~# /www/server/mysql/bin/mysql_upgrade
Looking for 'mysql' as: /www/server/mysql/bin/mysql
Looking for 'mysqlcheck' as: /www/server/mysql/bin/mysqlcheck
Error: Failed while fetching Server version! Could be due to unauthorized access.
FATAL ERROR: Upgrade failed

报错误

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/705035

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX