Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/57.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
升级到Ubuntu 18.04后重新安装mysql服务器-错误_Mysql_Ubuntu 18.04 - Fatal编程技术网

升级到Ubuntu 18.04后重新安装mysql服务器-错误

升级到Ubuntu 18.04后重新安装mysql服务器-错误,mysql,ubuntu-18.04,Mysql,Ubuntu 18.04,Mysql需要在我升级到Ubuntu 18.04后重新安装。升级之前我做了“sudo service mysqld stop”,然后清理步骤必须删除mysql服务器。当它没有找到时,我做了: sudo apt-get remove mysql-server sudo apt-get install mysql-server ... Setting up mysql-server-5.7 (5.7.22-0ubuntu18.04.1) ... update-alternatives: using

Mysql需要在我升级到Ubuntu 18.04后重新安装。升级之前我做了“sudo service mysqld stop”,然后清理步骤必须删除mysql服务器。当它没有找到时,我做了:

sudo apt-get remove mysql-server
sudo apt-get install mysql-server

...
Setting up mysql-server-5.7 (5.7.22-0ubuntu18.04.1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
mysqld: [Warning] World-writable config file '/etc/mysql/my.cnf' is ignored.
Please enable --log-error option or set appropriate redirections for standard output and/or standard error in daemon mode.
Warning: Unable to start the server. Please restart MySQL and run mysql_upgrade to ensure the database is ready for use.
mysqld: [Warning] World-writable config file '/etc/mysql/my.cnf' is ignored.
Please enable --log-error option or set appropriate redirections for standard output and/or standard error in daemon mode.
Warning: Unable to start the server.
...
然后我运行了“systemctl status mysql.service”,它报告了以下内容:

Jul 19 11:21:49 steve-VAIO mysqld[6106]: 2018-07-19T18:21:49.828124Z 0 [ERROR] InnoDB: Operating system error number 2 in a file oper
Jul 19 11:21:49 steve-VAIO mysqld[6106]: 2018-07-19T18:21:49.828132Z 0 [ERROR] InnoDB: The error means the system cannot find the pat
Jul 19 11:21:49 steve-VAIO mysqld[6106]: 2018-07-19T18:21:49.828140Z 0 [ERROR] InnoDB: Could not find a valid tablespace file for `my
Jul 19 11:21:49 steve-VAIO mysqld[6106]: 2018-07-19T18:21:49.828199Z 0 [Warning] InnoDB: Cannot calculate statistics for table `mysql
Jul 19 11:21:49 steve-VAIO mysqld[6106]: 2018-07-19T18:21:49.828232Z 0 [ERROR] Can't open and lock privilege tables: Tablespace is mi
Jul 19 11:21:49 steve-VAIO mysqld[6106]: 2018-07-19T18:21:49.846964Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180719 11:21:4
Jul 19 11:21:49 steve-VAIO mysqld[6106]: 2018-07-19T18:21:49.934673Z 0 [Note] Event Scheduler: Loaded 0 events
Jul 19 11:21:49 steve-VAIO mysqld[6106]: 2018-07-19T18:21:49.934950Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Jul 19 11:21:49 steve-VAIO mysqld[6106]: Version: '5.7.22-0ubuntu18.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu
Jul 19 11:21:49 steve-VAIO systemd[1]: Started MySQL Community Server.
mysqld正在运行,我的数据库也可用,但我确信当它更新时,这会再次困扰我。phpMyAdmin显示了mysql数据库,它看起来很健康。在数据库列表的顶部是一个名为“#mysql50#mysql.bkp”的数据库

有什么清理的建议吗

在建议运行mysql_升级后,我做了:

steve@steve-VAIO:~/workspace/JavascriptCourse$ mysql_upgrade -u root -p
mysql_upgrade: [Warning] World-writable config file '/etc/mysql/my.cnf' is ignored.
Enter password: 
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
mysql_upgrade: [ERROR] 1812: Tablespace is missing for table `mysql`.`plugin`.

因此,我将查找此表的表空间的修复程序。

您是否也升级了mysql服务器?您是否错过了这一步?您可能需要查看该警告“/etc/mysql/my.cnf”,并更改配置文件的权限。您发布的日志也被截断。我将备份、清除mysql并重新安装。我希望避免将其全部清除,因为我的一些数据库中有大量数据。更改权限确实会清除这些数据。