Error 1067: The process terminated unexpectedly MYSQL, Windows Server 2008 R2 - mysql

OS : Windows Server 2008 R2
MYSQL : MY SQL Server 5.6
ERROR :
2015-04-02 14:31:52 2956 [ERROR] InnoDB: .\ibdata1 can't be opened in read-write mode
2015-04-02 14:31:52 2956 [ERROR] InnoDB: The system tablespace must be writable!
2015-04-02 14:31:52 2956 [ERROR] Plugin 'InnoDB' init function returned error.
2015-04-02 14:31:52 2956 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2015-04-02 14:31:52 2956 [ERROR] Unknown/unsupported storage engine: InnoDB
2015-04-02 14:31:52 2956 [ERROR] Aborting
Steps Tried :
1. Deleted ib_logfile0 and ib_logfile1 and checked.
2. Edited my-default.ini
basedir="C:\mysql-5.6.11-win32\"
datadir="C:\mysql-5.6.11-win32\data\"
port=3306
server-id=1
bind-address=127.0.0.1
**Current files/folders in Mysql/data**:
WIN-BVVOL64R2ST.pid
WIN-BVVOL64R2ST.err
ibdata1
auto.CNF
performance_schema and
mysql
Need help to fix this, very much important.
And please let me know how can i take backup if MySQL service is not running.
Thanks in advance.

.\ibdata1 can't be opened in read-write mode
implies a permission problem, either on that file, or on the directory it is in.
Changing basedir will lose track of ibdata1, hence should be used with caution.

Related

Getting error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed" when starting MySQL

I found many similar question on Stackoverflow but didn't get the exact error solution.
My issue is when starting MySQL service on one of the Dedicated Centos 6.5 machine, I am getting error :
141018 05:13:46 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
141018 5:13:47 [Warning] Can't create test file /var/lib/mysql/ip-184-168-73-83.lower-test
141018 5:13:47 [Warning] Can't create test file /var/lib/mysql/ip-184-168-73-83.lower-test
/usr/libexec/mysqld: Can't create/write to file '/tmp/ibkTWnhE' (Errcode: 28)
141018 5:13:48 InnoDB: Error: unable to create temporary file; errno: 28
141018 5:13:48 [ERROR] Plugin 'InnoDB' init function returned error.
141018 5:13:48 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
141018 5:13:48 [ERROR] Can't start server : Bind on unix socket: No space left on device
141018 5:13:48 [ERROR] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
141018 5:13:48 [ERROR] Aborting
141018 5:13:48 [Note] /usr/libexec/mysqld: Shutdown complete
141018 05:13:48 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Here are free command status:
free -m
total used free shared buffers cached
Mem: 3743 3631 111 0 2705 21
-/+ buffers/cache: 905 2838
Swap: 2047 0 2047
This error also happens when your Database data is corrupt. You may fix this issue by moving your Db data files (ib_logfile0 and ib_logfile1) mentioned below to another location. ib_logfile0 and ib_logfile1 are system tablespace for the InnoDB infrastructure. These files contains several classes for information vital for InnoDB. You may read about these files here.
Before following below steps please keep a copy of files (ib_logfile0 and ib_logfile1) so you may restore your data in case it is lost:
Follow below steps:
Login to server via SSH with root access.
Navigate to /var/lib/mysql.
If you see files like, ib_logfile0 and ib_logfile1, rename or move them to some other folder.
Stop and start the MySQL service by running sudo service mysql stop and sudo service mysql start
These files will be recreated after you restart the server and the issue will be fixed hopefully.
Thanks
I have the same problems, this my solution:
Add more RAM to the server
Decrease the value of innodb-buffer-pool size in the config file:
sudo nano /etc/mysql/my.cnf
innodb_buffer_pool_size = 10M
After save /etc/mysql/my.cnf.
Restart mysql service:
sudo service mysql restart
exit
This is frequently occurred issue. Do following -
delete/move out these "aria_log_contro, ib_logfile0, ib_logfile1, ib_data1" files from location "..\xampp\mysql\data" and also from "..\xampp\mysql\backup".
stop and start apache server and mysql form xampp control panel
This should fix the issue; actually it worked for me.
NOTE: THIS IS GOING TO RESET THE DB IN MANY CASES BE VERY CAREFUL
Changing the values of innodb_buffer_pool_size and innodb_log_file_size didn't work for me.
Moving ib_logfile0 and ib_logfile1 files didn't help either.
What did help was:
> service mysql stop
Edit my.cfg and add innodb_force_recovery = 1
> service mysql start
> service mysql stop
Comment the innodb_force_recovery = 1 line.
> service mysql start
And voilá. (I should note that I have no idea if this involves any data loss or not)
Although late but putting answer here so that solution that helped me can help someone. I took following steps:
Added more RAM to sever
Decrease the value of innodb-buffer-pool size
Set innodb_log_file_size
Restart mysql
Example of addition to my.cnf:
innodb_buffer_pool_size = 10M
innodb_log_file_size = 1000M
After few unsuccess hours, i checked the disk space... and was full...
I was getting below mysql error log:-
[Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
InnoDB: Using Linux native AIO
InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
InnoDB: Completed initialization of buffer pool
InnoDB: Fatal error: cannot allocate memory for the buffer pool
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting
[Note] /usr/libexec/mysqld: Shutdown complete
I found out there are two solutions which are:-
1)Set innodb_log_file_size equal to the actual size of the existing InnoDB log files.
To see what size of innoDB log allocated, login mysql and enter following cmd:-
SHOW GLOBAL VARIABLES LIKE 'innodb_log_file_size';
Expected result example:- 5242880
After that, insert that value in my.cnf:-
vi /etc/my.cnf
innodb_log_file_size =5242880
2)Rename or move both the ./ib_logfile0 and ./ib_logfile1 files, and then start the MySQL server.This normally will be located at /var/lib/mysql. After start mysql, it create new innoDB log file and restore possible half-written data from the file of .ibd.
The expexted mysql log example:-
InnoDB: Database physically writes the file full: wait...
161216 9:58:54 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
161216 9:58:54 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
161216 9:58:54 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
161216 9:58:54 InnoDB: Waiting for the background threads to start
161216 9:58:55 InnoDB: 5.5.50 started; log sequence number 1589772
161216 9:58:55 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
161216 9:58:55 [Note] - '0.0.0.0' resolves to '0.0.0.0';
161216 9:58:55 [Note] Server socket created on IP: '0.0.0.0'.
161216 9:58:55 [Note] Event Scheduler: Loaded 0 events
161216 9:58:55 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.50' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL) by Remi
References:-
JUSTIN KULESZA (2011). MySQL: Failed Registration of InnoDB as a Storage Engine. Available at: https://spin.atomicobject.com/2011/05/09/mysql-failed-registration-of-innodb-as-a-storage-engine/.
RolandoMySQLDBA (2014). MySQL my.cnf: innodb_log_file_size is missing. Available at: https://dba.stackexchange.com/questions/75688/mysql-my-cnf-innodb-log-file-size-is-missing/158325#158325
Changing the Number or Size of InnoDB Redo Log Files. Available at: http://dev.mysql.com/doc/refman/5.7/en/innodb-data-log-reconfiguration.html
Nothing was working with reinstalls, removes, and others (I had no data to keep, not a fix; more of a data destruction process, big caveat there):
1005 mysql_install_db
1007 /usr/bin/mysqld_safe --datadir='/var/lib/mysql
1008 /usr/bin/mysqld_safe --datadir='/var/lib/mysql' (^z)
1009 bg
1010 mysql
1011 mysql_secure_installation
1012 mysql
1013 mysql -p
And viola; actually usable database.
for me the solution was to change the config to add
innodb_use_native_aio = 0
in mysql config
Just move this log file (ib_logfile0) to some other place for safer side and start the mysql services it worked for me.
I also met the same issue when restore a backup set made via innobackupex to a new instance. Finally ,the root cause is innodb_log_file_size doesn't match original instance that take the backup, and fix steps by steps like below:
Get innodb_log_file_size value from oragin instance via below command:
mysql uroot -ppasswd -NBe "show global variables like 'innodb_log_file_size';"
Modify the /etc/my.cnf of new instance with last get value:
vim /etc/my.cnf
Restart mysqld via :
systemctl restart mysqld

error in start MySql service in install Xammp

I have installed Apache and start Apache service in port 80. But after starting Apache service, MySql service not start and give me this error:
11:53:47 AM [mysql] Attempting to start MySQL service...
11:53:47 AM [mysql] Status change detected: running
11:53:53 AM [mysql] Status change detected: stopped
11:53:53 AM [mysql] Error: MySQL shutdown unexpectedly.
11:53:53 AM [mysql] This may be due to a blocked port, missing dependencies,
11:53:53 AM [mysql] improper privileges, a crash, or a shutdown by another method.
11:53:53 AM [mysql] Press the Logs button to view error logs and check
11:53:53 AM [mysql] the Windows Event Viewer for more clues
11:53:53 AM [mysql] If you need more help, copy and post this
11:53:53 AM [mysql] entire log window on the forums
So I have copy the error in log file:
2014-10-06 19:42:58 6820 [ERROR] Can't start server: Bind on TCP/IP port: No such file or directory
2014-10-06 19:42:58 6820 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2014-10-06 19:42:58 6820 [ERROR] Aborting
2014-10-06 19:49:17 3392 [ERROR] Can't start server: Bind on TCP/IP port: No such file or directory
2014-10-06 19:49:17 3392 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2014-10-06 19:49:17 3392 [ERROR] Aborting
2014-10-06 19:55:59 6260 [ERROR] InnoDB: Cannot create D:\xampp1\mysql\data\ib_logfile1
2014-10-06 19:55:59 6260 [ERROR] Plugin 'InnoDB' init function returned error.
2014-10-06 19:55:59 6260 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2014-10-06 19:55:59 6260 [ERROR] Unknown/unsupported storage engine: InnoDB
2014-10-06 19:55:59 6260 [ERROR] Aborting
2014-10-06 19:57:45 7920 [ERROR] InnoDB: space header page consists of zero bytes in data file D:\xampp1\mysql\data\ibdata1
2014-10-06 19:57:45 7920 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2014-10-06 19:57:45 7920 [ERROR] Plugin 'InnoDB' init function returned error.
2014-10-06 19:57:45 7920 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2014-10-06 19:57:45 7920 [ERROR] Unknown/unsupported storage engine: InnoDB
2014-10-06 19:57:45 7920 [ERROR] Aborting
2014-10-06 19:57:58 6240 [ERROR] InnoDB: space header page consists of zero bytes in data file D:\xampp1\mysql\data\ibdata1
2014-10-06 19:57:58 6240 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2014-10-06 19:57:58 6240 [ERROR] Plugin 'InnoDB' init function returned error.
2014-10-06 19:57:58 6240 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2014-10-06 19:57:58 6240 [ERROR] Unknown/unsupported storage engine: InnoDB
2014-10-06 19:57:58 6240 [ERROR] Aborting
2014-10-06 21:10:22 5612 [ERROR] InnoDB: space header page consists of zero bytes in data file D:\xampp1\mysql\data\ibdata1
2014-10-06 21:10:22 5612 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2014-10-06 21:10:22 5612 [ERROR] Plugin 'InnoDB' init function returned error.
2014-10-06 21:10:22 5612 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2014-10-06 21:10:22 5612 [ERROR] Unknown/unsupported storage engine: InnoDB
2014-10-06 21:10:22 5612 [ERROR] Aborting
.......
......
Please help me out to install this web server.
Thanks
stop your other mysql service
or
open C:\xampp\mysql\bin\my.ini then change the port
...
[mysqld]
port= 3306 <----- change to another port number
...
That is because that specific port is currently being used by another service.
http://www.sitepoint.com/unblock-port-80-on-windows-run-apache/
https://sites.google.com/site/anashkb/port-80-in-use
A similar question was also asked, you can view it
Apache server Installation failed(Port 80 or 443 already in use)
The Apache is uses port 80 and that port is already in use in your system (may be you are using skype).
In order to start the Apache please make free the port 80 in system. (sign out from skype or other program which using port 80). And try again.

mysqld: Can't create/write to file (Errcode: 13)

I installed mariadb on my archlinux box recently and wanted to run mysqld with different data and tmp directories
[mysqld]
user = mysql
port = 3306
datadir = <datapath>
tmpdir = <datapath>/tmp
When running mysqld I get the following error messages:
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.8
InnoDB: Using Linux native AIO
[ERROR] mysqld: Can't create/write to file '<datapath>/tmp/ib8dOkCX' (Errcode: 13)
InnoDB: Error: unable to create temporary file; errno: 13
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] mysqld: Can't create/write to file '<datapath>/aria_log_control' (Errcode: 13)
[ERROR] mysqld: Got error 'Can't create file' when trying to use aria control file '<datapath>/aria_log_control'
[ERROR] Plugin 'Aria' init function returned error.
[ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting
[Note] mysqld: Shutdown complete
I have made sure that the mysql user is the owner and has the proper permissions on the data and tmp directories.
When running mysqld as root, everything works just fine. When using the default tmpdir I still get the error when create/write to file /aria_log_control. Anyone who knows where I fail?
you should replace <datapath> with real path to data files which contains folder tmp

innoDB tablew are not showing after backup

I recently had problems with my win 7 so I had to reinstall.... and I had to reinstall web server too with mysql
before I had mysql 5.1 now I have 5.5.
I have made a backup from
C:\ProgramData\MySQL\MySQL Server 5.1\data (copied directories of my databases)
and I've copied all the directories now to
C:\ProgramData\MySQL\MySQL Server 5.5\data
when checking the result I get only myisqm tables showing, there is no innodb tables!
SHOW ENGINES gives me this
FEDERATED NO Federated MySQL storage engine NULL NULL NULL
MRG_MYISAM YES Collection of identical MyISAM tables NO NO NO
MyISAM YES MyISAM storage engine NO NO NO
BLACKHOLE YES /dev/null storage engine (anything you write to it... NO NO NO
CSV YES CSV storage engine NO NO NO
MEMORY YES Hash based, stored in memory, useful for temporary... NO NO NO
ARCHIVE YES Archive storage engine NO NO NO
InnoDB DEFAULT Supports transactions, row-level locking, and fore... YES YES YES
PERFORMANCE_SCHEMA YES Performance Schema NO NO NO
So what should I do? I checked and relevant files ARE in the directories... f.e.
classifieds.frm
classifieds.MYD
classifieds.MYI
ok, I stop the mysql55 service, I override the files:
- ibdata1
- ib_logfile0
- ib_logfile1
from my backup ... but when I re-start the service I get an error: The process terminated unexpectedly. when checking the log:
120429 9:52:29 [Note] Plugin 'FEDERATED' is disabled.
120429 9:52:29 InnoDB: The InnoDB memory heap is disabled
120429 9:52:29 InnoDB: Mutexes and rw_locks use Windows interlocked functions
120429 9:52:29 InnoDB: Compressed tables use zlib 1.2.3
120429 9:52:29 InnoDB: Initializing buffer pool, size = 59.0M
120429 9:52:29 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file .\ib_logfile0 is of different size 0 130023424 bytes
InnoDB: than specified in the .cnf file 0 31457280 bytes!
120429 9:52:29 [ERROR] Plugin 'InnoDB' init function returned error.
120429 9:52:29 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
120429 9:52:29 [ERROR] Unknown/unsupported storage engine: INNODB
120429 9:52:29 [ERROR] Aborting
120429 9:52:29 [Note] C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld: Shutdown complete
Did you get that the InnoDB data files are there? I.e. files are named like this:
- ibdata1
- ib_logfile0
- ib_logfile1
Then try to run from command line
mysql_upgrade -u root -p
then enter your password when prompted.
Ok, JScoobyCed suggested I change the size of the innodb_log_file_size in my.ini file...
after few tries I figured out the correct size.... in my case was innodb_log_file_size =124M since my backuped files ib_logfile0 and ib_logfile1 were about 126MB big
Thanks
I got my tables back, finally...
wooooo hooooo

Changing the data folder of MySQL database

I tried to change the data folder path of MySQL by changing the datadir parameter in the my.ini file. But when I restarted MySQL service again I get the following error :
Error 1067: the process terminated unexpectedly.
I checked the .err file, the following errors are present: (they are all about InnoDB)
120319 3:59:59 [Note] Plugin 'FEDERATED' is disabled.
120319 3:59:59 InnoDB: The InnoDB memory heap is disabled
120319 3:59:59 InnoDB: Mutexes and rw_locks use Windows interlocked functions
120319 3:59:59 InnoDB: Compressed tables use zlib 1.2.3
120319 3:59:59 InnoDB: Initializing buffer pool, size = 75.0M
120319 3:59:59 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file .\ib_logfile0 is of different size 0 99614720 bytes
InnoDB: than specified in the .cnf file 0 39845888 bytes!
120319 3:59:59 [ERROR] Plugin 'InnoDB' init function returned error.
120319 3:59:59 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
120319 3:59:59 [ERROR] Unknown/unsupported storage engine: INNODB
120319 3:59:59 [ERROR] Aborting
You have to specify the right size for:
innodb_log_file_size=95M in your my.cnf or my.ini. It is specified as 38M currently I guess.
Also check from your data folder as how many ib_logfiles you have. If you have more than 2, specify also: innodb_log_files_in_group=2.
Is this on Windows? If so one could use a VHD as storage device for MariaDB/MySQL. I've done so to prevent loss of data whenever I install or update the DB software (in Wamp, Xampp, Mamp, Wampserver etc.)
In order to do so I created a VHD with diskpart and mount it in boot time to the data folder in the respective MariaDB or MySQL folder (moving the original to data.orig first and copying it back as soon the device is running)
I use this script to mount the vhd at boot:
diskpart /s "C:\ProgramData\DB\connectvdisk\attach_mariadb-data.diskpart"
where attach_mariadb-data.diskpart contains
select vdisk file="c:\ProgramData\DB\mariadb-daten.vhdx"
attach vdisk
and the vhdx was set to mount to the proper location in Disk Manager.
The script is executed at boot time (trigger: At Startup) with Task Scheduler running cmd.exe with the following as parameter
/c "C:\ProgramData\DB\connectvdisk\connect-vhd.cmd"
I hijacked the ProgramData folder for this kind of storage. On some systems I've moved the scripts and device to secondary storage (D:) to be sure it survives a OS reinstall.
This continues to work on Windows 11