✓ Solved

Mysql Error in ubuntu 20.04

When I apt update my server I am getting a warning for mysql. I did not change anything about mysql. And it started to give this warning itself. And now i can not apt update server. It is saying "unable to start server"

This is the warning i am getting:

Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-8.0 (8.0.29-0ubuntu0.20.04.3) …
mysqld will log errors to /var/log/mysql/error.log
2022-05-07T16:21:07.152151Z 0 [ERROR] [MY-010946] [Server] Failed to start mysqld daemon. Check mysqld error log.
Warning: Unable to start the server.
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sat 2022-05-07 19:23:20 +03; 11ms ago
Process: 1513790 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Process: 1513813 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Main PID: 1513813 (code=exited, status=1/FAILURE)
Status: "Server upgrade complete"
Error: 2 (No such file or directory)

May 07 19:23:20 homelistt.com systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
May 07 19:23:20 homelistt.com systemd[1]: mysql.service: Failed with result 'exit-code'.
May 07 19:23:20 homelistt.com systemd[1]: Failed to start MySQL Community Server.
dpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-8.0; however:
Package mysql-server-8.0 is not configured yet.

dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-8.0
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

This is my error log:

2022-05-06T21:00:55.443981Z 0 [Warning] [MY-000081] [Server] option 'table_open_cache': unsigned value 33554432 adjusted to 524288.
2022-05-06T21:00:55.444030Z 0 [Warning] [MY-010139] [Server] Changed limits: max_open_files: 10000 (requested 1048661)
2022-05-06T21:00:55.444034Z 0 [Warning] [MY-010142] [Server] Changed limits: table_open_cache: 4957 (requested 524288)
2022-05-06T21:00:55.735981Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.29-0ubuntu0.20.04.3) starting as process 1339011
2022-05-06T21:00:55.745010Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-05-06T21:01:56.863636Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-05-06T21:01:59.369277Z 4 [System] [MY-013381] [Server] Server upgrade from '80028' to '80029' started.
2022-05-06T21:02:41.873440Z 4 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement '-- Copyright (c) 2015, 2021, Oracle and/or its affiliates. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; version 2 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- NOTE: This needs to be replicated within the sys_config_clean.inc file INSERT IGNORE INTO sys.sys_config (variable, value) VALUES ('statement_truncate_len', 64), ('statement_performance_analyzer.limit', 100), ('statement_performance_analyzer.view', NULL), ('diagnostics.allow_i_s_tables', 'OFF'), ('diagnostics.include_raw', 'OFF'), ('ps_thread_trx_info.max_length', 65535); ' failed with error code = 1436, error message = 'Thread stack overrun: 12560 bytes used of a 131072 byte stack, and 160000 bytes needed. Use 'mysqld --thread_stack=#' to specify a bigger stack.'.
2022-05-06T21:02:41.882600Z 0 [ERROR] [MY-013380] [Server] Failed to upgrade server.
2022-05-06T21:02:41.883461Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-05-06T21:02:42.811865Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.29-0ubuntu0.20.04.3) (Ubuntu).
2022-05-06T21:02:43.206570Z 0 [Warning] [MY-000081] [Server] option 'table_open_cache': unsigned value 33554432 adjusted to 524288.
2022-05-06T21:02:43.206627Z 0 [Warning] [MY-010139] [Server] Changed limits: max_open_files: 10000 (requested 1048661)
2022-05-06T21:02:43.206637Z 0 [Warning] [MY-010142] [Server] Changed limits: table_open_cache: 4957 (requested 524288)
2022-05-06T21:02:43.502566Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.29-0ubuntu0.20.04.3) starting as process 1339310
2022-05-06T21:02:43.514478Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-05-06T21:03:43.775350Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-05-06T21:03:46.222153Z 4 [System] [MY-013381] [Server] Server upgrade from '80028' to '80029' started.
2022-05-06T21:04:28.715553Z 4 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement '-- Copyright (c) 2015, 2021, Oracle and/or its affiliates. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; version 2 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- NOTE: This needs to be replicated within the sys_config_clean.inc file INSERT IGNORE INTO sys.sys_config (variable, value) VALUES ('statement_truncate_len', 64), ('statement_performance_analyzer.limit', 100), ('statement_performance_analyzer.view', NULL), ('diagnostics.allow_i_s_tables', 'OFF'), ('diagnostics.include_raw', 'OFF'), ('ps_thread_trx_info.max_length', 65535); ' failed with error code = 1436, error message = 'Thread stack overrun: 12560 bytes used of a 131072 byte stack, and 160000 bytes needed. Use 'mysqld --thread_stack=#' to specify a bigger stack.'.
2022-05-06T21:04:28.725073Z 0 [ERROR] [MY-013380] [Server] Failed to upgrade server.
2022-05-06T21:04:28.725916Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-05-06T21:04:29.708199Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.29-0ubuntu0.20.04.3) (Ubuntu).
2022-05-06T21:04:30.212038Z 0 [Warning] [MY-000081] [Server] option 'table_open_cache': unsigned value 33554432 adjusted to 524288.
2022-05-06T21:04:30.212089Z 0 [Warning] [MY-010139] [Server] Changed limits: max_open_files: 10000 (requested 1048661)
2022-05-06T21:04:30.212093Z 0 [Warning] [MY-010142] [Server] Changed limits: table_open_cache: 4957 (requested 524288)
2022-05-06T21:04:30.523494Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.29-0ubuntu0.20.04.3) starting as process 1339601
2022-05-06T21:04:30.534507Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-05-06T21:05:32.229568Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-05-06T21:05:34.823888Z 4 [System] [MY-013381] [Server] Server upgrade from '80028' to '80029' started.
2022-05-06T21:06:16.501650Z 4 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement '-- Copyright (c) 2015, 2021, Oracle and/or its affiliates. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; version 2 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- NOTE: This needs to be replicated within the sys_config_clean.inc file INSERT IGNORE INTO sys.sys_config (variable, value) VALUES ('statement_truncate_len', 64), ('statement_performance_analyzer.limit', 100), ('statement_performance_analyzer.view', NULL), ('diagnostics.allow_i_s_tables', 'OFF'), ('diagno:

Thank you.

7 Replies

✓ Best Answer

I looked at the .my.cnf on my server and I don't have any of that stuf. Just:

zzzzzzz:~$ cat .my.cnf
[mysql]
user=xxxxxx
password=yyyyyy

[mysqldump]
user=vvvvv
password=bbbbb

I have no includes.

So I would comment out each line by putting a pound-sign before it and see what happens.

Did you do the apt update / upgrade with sudo? If not, do it.

You might look in ~/ .my.cnf. If you have any of the stuff below in there you might comment it out as done here:

#query_cache_size = 0
#query_cache_type = 0
#query_cache_limit = 2M
#sort_buffer_size = 512K
#read_rnd_buffer_size = 512K
#tmp_table_size = 32M
#max_heap_table_size = 32M
#thread_pool_size = 24M
#innodb_log_file_size = 16M

Hi acanton77

My config file is like:

#

The MySQL database server configuration file.

#

You can copy this to one of:

- "/etc/mysql/my.cnf" to set global options,

- "~/.my.cnf" to set user-specific options.

#

One can use all long options that the program supports.

Run program with --help to get a list of available options and with

--print-defaults to see which it would actually understand and use.

#

For explanations see

http://dev.mysql.com/doc/mysql/en/server-system-variables.html

#

* IMPORTANT: Additional settings that can override those from this file!

The files must end with '.cnf', otherwise they'll be ignored.

#

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld]
max_allowed_packet = 1M
thread_stack = 128K
max_connections = 75
table_open_cache = 32M
key_buffer_size = 32M

In this guide https://www.linode.com/docs/guides/hosting-a-website-ubuntu-18-04/ it is said to configure the file like this.

So should i change the values? If yes how should my config file be?

@acanton77 I commented out the lines that i added in file. And it managed to restart but when i apt update it said "mysqld is running as pid 1649975" Later i apt upate it again and it strated successfully without a warning. But i have a question:my linode has 2 GB Ram and 1 GB GPU and in the guide I mentioned above it is saying to optimize the mysql conf file. If it will harm the system why did they put that instruction there?

zzzzzzz:~$ sudo apt-get upgrade -y
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-8.0 (8.0.29-0ubuntu0.20.04.3) …
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 1525976
Setting up mysql-server (8.0.29-0ubuntu0.20.04.3) …
zzzzz:~$ sudo less /var/log/mysql/error.log
zzzzz:~$ sudo apt update
Hit:1 http://mirrors.linode.com/ubuntu focal InRelease
Hit:2 http://mirrors.linode.com/ubuntu focal-updates InRelease
Hit:3 http://mirrors.linode.com/ubuntu focal-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:5 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:6 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease
Reading package lists… Done
Building dependency tree
Reading state information… Done
All packages are up to date.
zzzzzz:~$ sudo apt-get upgrade -y
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

in the guide I mentioned above it is saying to optimize the mysql conf file.

  1. The guide you posted the link for is for Ubuntu 18.04 but you are using 20.04. Wrong guide!

  2. The guide says to put the values you mentioned in apache.conf, not in .my.cmf. (.my.cnf has some other values you can put in.)

My guess is: USER ERROR.

@acanton77 what are the values to put in mysql config file for 2 GB RAM 1gb GPU, UBUNTU 20.04?

Do you mean the .my.cfg ? I pasted it above. All that is in there is some password stuff, which I didn't put it and don't know (or care) how it got there!

I don't mess with MySQL configurations. I've learned from long, long experience that MySQL is held together with a bit of super glue and duct-tape. It is prone to 'issues' out of the box. You start 'messing' with it to try to gain a nanosecond of performance, and you may be very sorry. I don't know if the fork… Maria… is the same.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct