mysql InnoDB: Unable to lock ./#innodb_redo/#ib_redo0 error: 13 - mysql

2022-07-31T10:46:33.631091Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30-0ubuntu0.20.04.2) starting as process 1268525
2022-07-31T10:46:33.680919Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-07-31T10:46:35.911807Z 1 [ERROR] [MY-012574] [InnoDB] Unable to lock ./#innodb_redo/#ib_redo0 error: 13
2022-07-31T10:46:35.911857Z 1 [ERROR] [MY-012894] [InnoDB] Unable to open './#innodb_redo/#ib_redo0' (error: 11).
2022-07-31T10:46:35.911872Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Cannot open a file.
2022-07-31T10:46:36.124480Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-07-31T10:46:36.124674Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-07-31T10:46:36.124690Z 0 [ERROR] [MY-010119] [Server] Aborting
This instance of mysql has been running fine for over a year on ubuntu. The server crashed and generated a crash log - now I get this error when trying to restart the server. I have looked at other posts and have verified/tried:
A) There is not another mysql instance running
B) AppArmor has been edited to allow access (nothing has changed & re-verified)
Looking at the file it is trying to lock, nothing jumps out at me on why it can not lock it:
-rwxr-xr-x 1 mysql mysql 3276800 Jul 29 06:20 '#ib_redo0'*
Suggestions? What am I missing?

Related

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

I used the Digitalocean one-click installation to set up a Ghost instance on my server and I recently noticed that the site is showing a 502 gateway error, when I logged in to check I found that the server is not active.
I get this error and I’m not able to start the MySQL server.
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
I followed this guide here https://www.digitalocean.com/community/tutorials/how-to-troubleshoot-socket-errors-in-mysql
But I found that I don’t even have the /var/run/mysqld/ directory When I try to cd or ls that directory, it shows the directory does not exist.
I guess my own case is different, I browsed around the internet and found this solution that suggested I add
innodb_force_recovery = 6
https://askubuntu.com/questions/1185783/how-fix-permanently-job-for-mysql-service-failed-because-the-control-process-ex
After adding that code, it still does not solve the problem
When I go into the /var/log/mysql/error.log file I get this
2022-08-08T01:40:28.108418Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30-0ubuntu0.20.04.2) (Ubuntu).
2022-08-08T01:40:28.677008Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30-0ubuntu0.20.04.2) starting as process 271100
2022-08-08T01:40:28.688821Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-08T01:40:28.928619Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-08-08T01:40:29.023994Z 1 [Warning] [MY-011018] [InnoDB] Skip updating information_schema metadata in InnoDB read-only mode.
2022-08-08T01:40:29.229659Z 1 [Warning] [MY-010005] [Server] Skip re-populating collations and character sets tables in InnoDB read-only mode.
2022-08-08T01:40:29.235974Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-08-08T01:40:29.236037Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-08T01:40:29.760446Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30-0ubuntu0.20.04.2) (Ubuntu).
Thank you so much for your help!

The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it. error in mysql image

after I changed data directory of docker (i.e /etc/docker/daemon.json), I get the following error while I'm trying to run mysql image
2022-07-13T10:31:27.580551Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.29) initializing of server in progress as process 43
2022-07-13T10:31:27.584905Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-07-13T10:31:27.588941Z 1 [ERROR] [MY-012576] [InnoDB] Unable to create temporary file inside "/tmp"; errno: 13
2022-07-13T10:31:27.588965Z 1 [ERROR] [MY-012929] [InnoDB] InnoDB Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
2022-07-13T10:31:27.589074Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-07-13T10:31:27.589091Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
2022-07-13T10:31:27.589141Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-07-13T10:31:27.589437Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.29) MySQL Community Server - GPL.
The "real" problem is shown earlier in this line:
2022-07-13T10:31:27.588941Z 1 [ERROR] [MY-012576] [InnoDB] Unable to create temporary file inside "/tmp"; errno: 13
MySQL seems to have problems writing your /tmp directory. Please check the permissions for the directory and/or the docker configuration.
After this is fixed you can remove the mentioned data directory (/var/lib/mysql) and try again. But please be careful if you had any existing databases in the directory before ;-)

Unable to start MySQL 8.0.12 after lower_case_table_names Settings

I have same issue as the link per
lower_case_table_names Settings in MySQL 8.0.12
I followed the steps of stackprotector till step no 6 and log file show below
2021-06-18T09:35:13.134465Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-06-18T09:35:14.078706Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-06-18T09:35:14.966455Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root#localhost: 5ip,8m>awvsJ
On step 7, i am unable to start the mysql server
The command i used is mysqld instead of mysql
sudo service mysqld start
I have the error log as below
2021-06-18T09:36:04.023595Z 0 [System] [MY-010116] [Server] /usr/libexec/mysqld (mysqld 8.0.21) starting as process 31701
2021-06-18T09:36:04.030626Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-06-18T09:36:04.030713Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 13 in a file operation.
2021-06-18T09:36:04.030749Z 1 [ERROR] [MY-012595] [InnoDB] The error means mysqld does not have the access rights to the directory.
2021-06-18T09:36:04.030777Z 1 [ERROR] [MY-012270] [InnoDB] os_file_get_status() failed on './ibdata1'. Can't determine file permissions
2021-06-18T09:36:04.030809Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2021-06-18T09:36:04.030927Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2021-06-18T09:36:04.030989Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-06-18T09:36:04.031285Z 0 [System] [MY-010910] [Server] /usr/libexec/mysqld: Shutdown complete (mysqld 8.0.21) Source distribution.
What's being wrong here?
I have grant all permission on
chmod 777 /var/lib/mysql

Unable to start the mysql in aws instance ec2 WordPress

I thought of securing my wordpress i have changes the file permission system.
now my mysql server is not starting and i am getting wordpress database connection error
mysqld.log
2020-08-24T16:34:16.593492Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2020-08-24T16:34:16.596808Z 0 [System] [MY-010116] [Server] /opt/bitnami/mysql/bin/mysqld.bin (mysqld 8.0.17) starting as process 1773
2020-08-24T16:34:16.842762Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2020-08-24T16:34:16.842772Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2020-08-24T16:34:16.842787Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2020-08-24T16:34:16.842800Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2020-08-24T16:34:16.842814Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.

Cannot get Mysql 8.0 to stay open in Mac OS

MySQL suddenly cannot keep open. I tried
ps -ef | grep mysql
sudo kill -9 5211
I tried removing my my.cnf
I tried creating a new my.cnf as suggested by a previous post
Nothing is working. mySQL from "System Preference" turns on after I put my password and few seconds later turns off.
Here is the error log:
2019-02-14T01:13:17.285925Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.12/bin/mysqld (mysqld 8.0.12) starting as process 11402
2019-02-14T01:13:17.288972Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2019-02-14T01:13:17.317235Z 1 [ERROR] [MY-012592] [InnoDB] InnoDB: Operating system error number 2 in a file operation.
2019-02-14T01:13:17.317441Z 1 [ERROR] [MY-012593] [InnoDB] InnoDB: The error means the system cannot find the path specified.
2019-02-14T01:13:17.317548Z 1 [ERROR] [MY-012594] [InnoDB] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2019-02-14T01:13:17.317666Z 1 [ERROR] [MY-012646] [InnoDB] InnoDB: File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2019-02-14T01:13:17.317798Z 1 [ERROR] [MY-012981] [InnoDB] InnoDB: Cannot continue operation.
2019-02-14T01:15:15.776723Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.12/bin/mysqld (mysqld 8.0.12) starting as process 12646
2019-02-14T01:15:15.779642Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2019-02-14T01:15:15.796296Z 1 [ERROR] [MY-012592] [InnoDB] InnoDB: Operating system error number 2 in a file operation.
2019-02-14T01:15:15.796337Z 1 [ERROR] [MY-012593] [InnoDB] InnoDB: The error means the system cannot find the path specified.
2019-02-14T01:15:15.796352Z 1 [ERROR] [MY-012594] [InnoDB] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2019-02-14T01:15:15.796365Z 1 [ERROR] [MY-012646] [InnoDB] InnoDB: File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2019-02-14T01:15:15.796380Z 1 [ERROR] [MY-012981] [InnoDB] InnoDB: Cannot continue operation.
Here is the error. I will check what it means.
Since you have removed .cnf file, so it is expecting ./ibdata1 file in current folder and it is not there. Usually data directory is defined in .cnf file with datadir property.
e.g
datadir=/var/lib/mysql
And this ibdata1 is in datadir folder.