mysql - Can't lock aria control file - mysql

I'm having problems with MariaDB, while it was first working fine. I only restarted the server, when I couldn't start the MySQL daemon anymore. It seems to still be using my old USB-stick's file path (/media/brood), while I already switched over to a new HDD instead (/media/seagate). This is the error I'm getting in /var/log/mysql/error.log:
160728 9:32:32 [ERROR] mysqld: Can't lock aria control file '/media/brood/mysql/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds
160728 9:33:03 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/media/brood/mysql/aria_log_control'
160728 9:33:03 [ERROR] Plugin 'Aria' init function returned error.
160728 9:33:03 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
160728 9:33:03 [Note] InnoDB: Using mutexes to ref count buffer pool pages
160728 9:33:03 [Note] InnoDB: The InnoDB memory heap is disabled
160728 9:33:03 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
160728 9:33:03 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
160728 9:33:03 [Note] InnoDB: Compressed tables use zlib 1.2.8
160728 9:33:03 [Note] InnoDB: Using Linux native AIO
160728 9:33:03 [Note] InnoDB: Not using CPU crc32 instructions
160728 9:33:03 [Note] InnoDB: Initializing buffer pool, size = 128.0M
160728 9:33:03 [Note] InnoDB: Completed initialization of buffer pool
160728 9:33:03 [ERROR] InnoDB: Unable to lock ./ib_logfile0, error: 11
160728 9:33:03 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
160728 9:33:03 [ERROR] InnoDB: Unable to open './ib_logfile0'
160728 9:33:03 [ERROR] Plugin 'InnoDB' init function returned error.
160728 9:33:03 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160728 9:33:03 [Note] Plugin 'FEEDBACK' is disabled.
mysqld: Too many arguments (first extra is 'stop').
160728 9:33:03 [ERROR] Aborting
160728 9:33:03 [Note] mysqld: Shutdown complete
It could also be permission issues, or maybe files are still locked (I don't know how that works), because the last time the Raspberry Pi restarted, it was because someone accidentally pulled out the power plug of the Pi.

Why the log contained the path to the old mysql data folder is still a mystery to me. (It's not even the previous USB-stick, to make the story more complete, it's actually the USB-stick I used before that!) But, the problem is solved! The answer was actually much simpler than I thought, it turns out, my brother uninstalled something (an emulator for playing old games, he said), when he noticed it uninstalled mariadb-server-10.0 (strange!). So I did a simple sudo apt-get install mariadb-server-10.0, and guess what! It solved my problem! :D

Related

MySql service won't start from recovered ibdata1 file

One of our servers was the subject of a ransomware attack from a group of international Hackers. So we’ve re-grouped and started over and the only unaffected data we had was the ibdata1 file stored in mysql program data folder.
We would like to restore that data on the new instance so that we carry forward our operations but after trying to run the new installation of mysql it the service stops with error 1067. It suggests to delete all files created by InnoDB: all ibdata files and all ib_logfile files. If I do that the service will run but I can’t do it because I need to access the data in this particular data file. I’ve also added these two lines in my .cnf file
innodb_force_recovery=6
innodb_fast_shutdown=0
That hasn’t worked. So I deleted just the log files and it created new log files along with it came this error
190223 11:38:48 [Note] Plugin 'FEDERATED' is disabled.
190223 11:38:48 InnoDB: The InnoDB memory heap is disabled
190223 11:38:48 InnoDB: Mutexes and rw_locks use Windows interlocked functions
190223 11:38:48 InnoDB: Compressed tables use zlib 1.2.3
190223 11:38:48 InnoDB: Initializing buffer pool, size = 2.0G
190223 11:38:48 InnoDB: Completed initialization of buffer pool
190223 11:38:48 InnoDB: highest supported file format is Barracuda.
InnoDB: No valid checkpoint found.
InnoDB: If this error appears when you are creating an InnoDB database,
InnoDB: the problem may be that during an earlier attempt you managed
InnoDB: to create the InnoDB data files, but log file creation failed.
InnoDB: If that is the case, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/error-creating-innodb.html
190223 11:38:48 [ERROR] Plugin 'InnoDB' init function returned error.
190223 11:38:48 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
190223 11:38:48 [ERROR] Unknown/unsupported storage engine: INNODB
190223 11:38:48 [ERROR] Aborting
Then I replaced the log files with the same ones I used with the original ibdata1 file then I got this error.
190223 12:11:26 [Note] Plugin 'FEDERATED' is disabled.
190223 12:11:26 InnoDB: The InnoDB memory heap is disabled
190223 12:11:26 InnoDB: Mutexes and rw_locks use Windows interlocked functions
190223 12:11:26 InnoDB: Compressed tables use zlib 1.2.3
190223 12:11:26 InnoDB: Initializing buffer pool, size = 2.0G
190223 12:11:26 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file .\ib_logfile0 is of different size 0 1073741824 bytes
InnoDB: than specified in the .cnf file 0 224395264 bytes!
190223 12:11:26 [ERROR] Plugin 'InnoDB' init function returned error.
190223 12:11:26 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
190223 12:11:26 [ERROR] Unknown/unsupported storage engine: INNODB
190223 12:11:26 [ERROR] Aborting
It appears there is a check point somewhere in the log files that is necessary for the data file to be read properly by the mysql service. Maybe I need to specify the log file size in the my.ini config file. But I don’t know how to go about it.
Any help will really come in handy here.
In your my.ini (or my.cnf) file, add (or replace) the following line:
innodb_log_file_size = 1024M
See https://dev.mysql.com/doc/refman/5.6/en/innodb-parameters.html#sysvar_innodb_log_file_size for details.

MySQL has broke, can not be started: "Restoring possible half-written data pages from the doublewrite buffer..."

When attempting to start the mysql server, it returns with exit code 1. I've done this a million times before on this server. Without messing with the server in the past month, mysql has suddenly stopped and I can not start it. My error.log:
[Note] InnoDB: Using mutexes to ref count buffer pool pages
[Note] InnoDB: The InnoDB memory heap is disabled
[Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
[Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
[Note] InnoDB: Compressed tables use zlib 1.2.8
[Note] InnoDB: Using Linux native AIO
[Note] InnoDB: Using SSE crc32 instructions
[Note] InnoDB: Initializing buffer pool, size = 128.0M
[Note] InnoDB: Completed initialization of buffer pool
[Note] InnoDB: Highest supported file format is Barracuda.
[Note] InnoDB: Starting crash recovery from checkpoint LSN=591771482442
Everything goes to ruin below this line.
[Note] InnoDB: Restoring possible half-written data pages from the doublewrite buffer...
InnoDB: Set innodb_force_recovery to ignore this error.
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[Note] Plugin 'FEEDBACK' is disabled.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting
Until I can start mysql-server, I can not run mysqldump nor mysql -u root:
Got error: 2002: "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")" when trying to connect
I'm running mariadb-server 10.1.23-9-deb9u1.
Not sure if this will work but since the server doesn't work anyway so try this out:
Rename logfile0 and logfile1 and then restart the server.
Before doing anything, make a copy of the entire mysql folder to another location just in case.
The answer was right infront of me:
InnoDB: Set innodb_force_recovery to ignore this error.
I set innodb_force_recovery = 1 after the [mysqld] clause in my /etc/mysql/mariadb.conf.d/50-server.cnf (This file may very depending on your OS).
I restarted it and it repaired itself. I later took out the innodb_force_recovery = 1 and restarted again, it then worked just fine.
What did I learn? Have more faith in "auto-repair" procedures. My expectations were so low for them because of my exposure to Microsoft Windows.

Mysql server is not getting started on Amazon ec2

I have installed mysql server on ec2 AMI. Suddenly stopped working mysql server and its not getting started.
Here is mysql log :
160629 4:28:37 [Note] /usr/libexec/mysql55/mysqld (mysqld 5.5.46) starting as process 3059 ...
160629 4:28:37 [Note] Plugin 'FEDERATED' is disabled.
160629 4:28:37 InnoDB: The InnoDB memory heap is disabled
160629 4:28:37 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160629 4:28:37 InnoDB: Compressed tables use zlib 1.2.8
160629 4:28:37 InnoDB: Using Linux native AIO
160629 4:28:37 InnoDB: Initializing buffer pool, size = 512.0M
160629 4:28:37 InnoDB: Completed initialization of buffer pool
160629 4:28:37 InnoDB: highest supported file format is Barracuda.
InnoDB: No valid checkpoint found.
InnoDB: If this error appears when you are creating an InnoDB database,
InnoDB: the problem may be that during an earlier attempt you managed
InnoDB: to create the InnoDB data files, but log file creation failed.
InnoDB: If that is the case, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/error-creating-innodb.html
160629 4:28:37 [ERROR] Plugin 'InnoDB' init function returned error.
160629 4:28:37 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160629 4:28:37 [ERROR] Unknown/unsupported storage engine: InnoDB
160629 4:28:37 [ERROR] Aborting
160629 4:28:37 [Note] /usr/libexec/mysql55/mysqld: Shutdown complete
160629 04:28:37 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Here are approach what I have tried yet:
1) Upgraded EC2 t2.micro to t2.medium.
2) Increased innodb_buffer_pool_size in my.cnf
3) Rename ib_logfile0 and ib_logfile1
Please suggest what next step should I do to start mysql.
Edit:
Sudo free -m
total used free shared buffers cached
Mem: 3954 149 3805 0 9 86
-/+ buffers/cache: 53 3901
Edit:
Is there only solution to uninstall mysql and re-install ?
If yes, then how can retain already created databases in mysql? Please Suggest.
Please go through the below link which is being given in your error logs.
It has mentioned certain steps to solve runtime exception .You can cross check and proceed. If nothing helped than you can opt for uninstallation.
http://dev.mysql.com/doc/refman/5.5/en/error-creating-innodb.html

Mysql stops working in my ubuntu machine 13.04

I am facing this weird issue. Suddenly mysql stops working and i am getting error log in /var/log/mysql/error.log
**
140501 17:21:09 [Note] Plugin 'FEDERATED' is disabled.
140501 17:21:09 InnoDB: The InnoDB memory heap is disabled
140501 17:21:09 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140501 17:21:09 InnoDB: Compressed tables use zlib 1.2.3.4
140501 17:21:10 InnoDB: Initializing buffer pool, size = 128.0M
140501 17:21:10 InnoDB: Completed initialization of buffer pool
140501 17:21:10 InnoDB: highest supported file format is Barracuda.
InnoDB: No valid checkpoint found.
InnoDB: If this error appears when you are creating an InnoDB database,
InnoDB: the problem may be that during an earlier attempt you managed
InnoDB: to create the InnoDB data files, but log file creation failed.
InnoDB: If that is the case, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/error-creating-innodb.html
140501 17:21:10 [ERROR] Plugin 'InnoDB' init function returned error.
140501 17:21:10 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140501 17:21:10 [ERROR] Unknown/unsupported storage engine: InnoDB
140501 17:21:10 [ERROR] Aborting
140501 17:21:10 [Note] /usr/sbin/mysqld: Shutdown complete
**
Its very itching problem as I can write a single code without myqsl connection. How to solve this issue.
PS: Sorry Ubuntu fellas as I am using 13.04 unsupported version, I have already installed 14.04 and will move to it in a couple of days.
After going through lots of suggestions I found in stackoverflow and other mysql related websites, I did not success to fix this issue. then I reconfigure my mysql installations and voila its working now.
Command I used is
sudo dpkg-reconfigure mysql-server-5.5

Mysql / InnoDB stops working?

I've been running a new server instance fine for the past two weeks. Starting today, mysql stoped working by itself, and here is the logs I'm getting.
130922 13:32:39 [Note] Plugin 'FEDERATED' is disabled.
130922 13:32:39 InnoDB: The InnoDB memory heap is disabled
130922 13:32:39 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130922 13:32:39 InnoDB: Compressed tables use zlib 1.2.3.4
130922 13:32:39 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(135987200 bytes) failed; errno 12
130922 13:32:39 InnoDB: Completed initialization of buffer pool
130922 13:32:39 InnoDB: Fatal error: cannot allocate memory for the buffer pool
130922 13:32:39 [ERROR] Plugin 'InnoDB' init function returned error.
130922 13:32:39 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130922 13:32:39 [ERROR] Unknown/unsupported storage engine: InnoDB
130922 13:32:39 [ERROR] Aborting
130922 13:32:39 [Note] /usr/sbin/mysqld: Shutdown complete
From what I'm looking at, it seems that there is a problem allocating memory to the databases (there are only a wordpress installed on this machine)... Although, Googling around gives me multiple answers to multiple problem, and I'm not quite sure what do do now.
Right now, the only way to solve the problem is to reboot the machine, then mysql will work again until the next time I see that kind of messages in the log.
Should I try to find a way to change anything in my.cnf for memory? Or is there any other avenue that you could suggest?
In the end, I moved the server over new specs with higher memory and it seems it did the trick, as #Bill-Karwin suggested.