Cannot start MySql server - mysql

I have problem starting the MySql server.
The log says:
InnoDB: Error in opening ./ibdata1
111220 16:16:43 InnoDB: Operating system error number 11 in a file operation.
InnoDB: Error number 11 means 'Resource temporarily unavailable'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/operating-system-error-codes.html
InnoDB: Could not open or create data files.
InnoDB: If you tried to add new data files, and it failed here,
InnoDB: you should now edit innodb_data_file_path in my.cnf back
InnoDB: to what it was, and remove the new ibdata files InnoDB created
InnoDB: in this failed attempt. InnoDB only wrote those files full of
InnoDB: zeros, but did not yet use them in any way. But be careful: do not
InnoDB: remove old data files which contain your precious data!
/usr/libexec/mysqld: Disk is full writing './mysql-bin.000028' (Errcode: 28). Waiting for someone to free space... Retry
in 60 secs
After I check the disk - it says it's full.
So, after searching for solution - I found that I need to purge the binary log.
However, in order to purge - I need to start the MySql server, but all the spacein the disk is taken by the binary log, so I can't start...
It's also not advised to simply delete the binary logs.
So, I am kind of stuck.
Can't run the mysql to purge logs and can't purge logs because can't run server.
Any help? :)
Edit: The disk contains only the logs, there's nothing else.

If the disk is ext[2|3|4] you can use tune2fs to set the portion of the disk reserved for root to 0, giving you maybe enough breathing room to start the server
this would be tune2fs -m 0 /dev/whatever (after unmounting, ofcourse)

Try to start the mysql server with the option --expire_logs_days=, it should delete the log and older than days directory at startup.
bye
Gianluca

Related

MySQL Server Fails to Start on PowerPC Architecture

I downloaded the source code of MySQL-5.5.34 and compiled it according to the instructions.
Then in the /usr/local/mysql/bin folder I did ./mysqld_safe --user=root &
The mysql server started and closed immediately.
The /usr/local/mysql/data/p2020rdb.err reads
mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
The InnoDB memory heap is disabled
Mutexes and rw_locks use GCC atomic builtins
Compressed tables use zlib 1.2.8
.
.
.
.
File './mysql-bin.000011' not found ( Errcode: 2)
Failed to open log (file './mysql-bin.000011', errno 2)
Could not open log file
Can't init tc log
Aborting
InnoDB: Starting Shutdown +
InnoDB: Shutdown completed: log sequence number
I will greatly appreciate any help on this problem.
Basically, MySQL is looking in the mysql-bin.index file and it cannot find the log files that are listed within the index. This will keep MySQL from starting, but the fix is quick and easy. You have two options:
Edit the index file
You can edit the mysql-bin.index file in a text editor of your choice and remove the references to any logs which don’t exist on the filesystem any longer. Once you’re done, save the index file and start MySQL.
Take away the index file
Move or delete the index file and start MySQL. This will cause MySQL to reset its binary log numbering scheme, so if this is important to you, you may want to choose the previous option.
So how do you prevent this from happening? Use the PURGE MASTER LOGS statement and allow MySQL to delete its logs on its own terms. If you’re concerned about log files piling up, adjust the expire_logs_days variable in your /etc/my.cnf.

MySQL no longer starts (but it used to) on xampp

mySQL won't start and it throws up this in the log: http://pastebin.com/rTvMiQFV.
This seems quite common on here, but none of the solutions I've read have worked.
The only difference I can see between my problem and everyone else's is that mine has only just started happening, I was using it just fine before and it stopped at random after I restarted my computer.
It's happened before, and after trying everything I ended up backing up my databases and reinstalling the whole of xampp, but I don't really want to do that.
Any suggestions?
Did you try doing the suggested steps:
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.

XAMPP: MYSQL stops working after I restart

I am having problems with starting MYSQL in XAMPP. Apache starts alright but then MYSQL keeps reporting an unexpected shutdown.
I was led to delete C:\xampp\mysql\data\ibdata1 and it works after that but that deletes all my databases and MYSQL stops working again after I restart my machine.
I went through the error logs and this is what I saw:
[ERROR] InnoDB: Attempted to open a previously opened tablespace.
Previous tablespace mysql/innodb_index_stats uses space ID: 2 at
filepath: .\mysql\innodb_index_stats.ibd. Cannot open tablespace
yiicrud/customer which uses space ID: 2 at filepath:
.\yiicrud\customer.ibd InnoDB: Error: could not open single-table
tablespace file .\yiicrud\customer.ibd InnoDB: We do not continue the
crash recovery, because the table may become InnoDB: corrupt if we
cannot apply the log records in the InnoDB log to it. InnoDB: To fix
the problem and start mysqld: InnoDB: 1) If there is a permission
problem in the file and mysqld cannot InnoDB: open the file, you
should modify the permissions. InnoDB: 2) If the table is not needed,
or you can restore it from a backup, InnoDB: then you can remove the
.ibd file, and InnoDB will do a normal InnoDB: crash recovery and
ignore that table. InnoDB: 3) If the file system or the disk is
broken, and you cannot remove InnoDB: the .ibd file, you can set
innodb_force_recovery > 0 in my.cnf InnoDB: and force InnoDB to
continue crash recovery here.
Adding this line in my.cnf worked for me:
innodb_force_recovery = 1
There is a solution on this page: XAMPP/MySQL: could not open single-table tablespace file .\mysql\innodb_index_stats.ibd after restart of MySQL
Move (DON'T DELETE) those files, into another folder:
innodb_index_stats.frm <br>
innodb_table_stats.frm <br>
slave_worker_info.frm <br>
slave_master_info.frm <br>
slave_relay_log_info.frm <br>
and .ibd files with the same filename.
Try start MySQL.
Thanks a lot everyone.
I have able to solve it. It appears the database was created in a later version and was incompatible with this new version of xampp so i created the databases again and imported the tables into them. Previously I was importing the database with the create statements as well.
Had the idea from Salman's comment.
Try this
rename the XAMMP\mysql\data folder to any other name you wish (say data_old )
make a new folder in XAMMP\mysql name data and copy all the files in it including ibdata1
close all running programs and restart XAMPP
No need to copy files from data_old but if you do have previously constructed databases then you may copy some files from data_old.
The solution may come again. If it then you have to change the port to something else like 3308 in the config settings as well as in phpMyAdmin/config.inc.php.
If the problem stays still then its better to change the application which uses the port 3306 and set default settings in XAMPP.

mysqld working but wampmysqld not starting up

Following up from here: Wampserver icon not going green fully, mysql services not starting up?
I can see that mysqld is working now. But wampmysqld is still not working as a service!
d:\wamp\bin\mysql\mysql5.5.8\bin>mysqld.exe --console
130721 12:10:45 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use Windows interlocked functions
InnoDB: Compressed tables use zlib 1.2.3
130721 12:10:45 InnoDB: Initializing buffer pool, size = 128.0M
130721 12:10:45 InnoDB: Completed initialization of buffer pool
130721 12:10:45 InnoDB: highest supported file format is Barracuda.
130721 12:10:45 InnoDB: 1.1.4 started; log sequence number 1595675
130721 12:10:45 [Note] Event Scheduler: Loaded 0 events
130721 12:10:45 [Note] mysqld.exe: ready for connections.
Version: '5.5.8' socket: '' port: 3306 MySQL Community Server (GPL)
I've deleted all files in the mysql /data/ folder and when I ran mysqld, a new ibdata1 file was created. So handling InnoDB files seems fine. But wampmysqld still gives Error 1067.
These are the last lines on the mysql error log generated by wampserver:
130720 10:28:45 [Note] Event Scheduler: Purging the queue. 0 events
130720 10:28:46 InnoDB: Starting shutdown...
130720 10:28:52 InnoDB: Shutdown completed; log sequence number 29711976
130720 10:28:52 [Note] wampmysqld: Shutdown complete
This means it closed down yesterday morning around half past ten, and it's just not starting up after that!
I had same problem, and solution was:
go to services,(type command services.msc in run) find mysql service which is installed outside of wamp right click on it and stop.
then again in services panel go to wampmysqld64-> right click-> start
if you need only wamp's mysql version then you can turn other mysql service off.
it fixed my problem. Hope this helps!
This is what worked for me: http://jinengbali.wordpress.com/2010/04/20/mysql-server-stop-working-in-wampserver-error-wampmysqld-shutdown-complete/
I installed an "addon" and then from the wampserver icon selected > MySQL > Version and selected one of the newly installed version. The icon finally went green!
Actually it shouldn't work.
Apparently you have hard-copied some database files into "data" folder.
Just let you know, the mysql doesn't like such things and will never ever start. Just imagine for security reasons that somebody added files to your server. Probably you have added those files while the server was already started and no issues were expected.
Two things you could do:
Remove the index file mysql-bin.index on Linux( i do not know the corresponding file for Windows).
You should simply remove the added files from 'data' folder and it will then turn to green.
Rule: Try to add databases by csv import options, but never add them manually as folders.
reinstall the entire wampserver again in your computer the wampmysqld file will be allocated back by system .as simple as that.
I got a similar problem go to mysql and open up the log file should find the cause of the error .
1.In my case the log file was absent so I created a new one.
2.In another case you could have a read error on your log file so could result to an error in this case just locate and delete the problematic file my path for the file "C:\wamp\logs" once it is done try openning the sql log from wamp panel.
3.If you tried all of the above methods and had no result try to look in the log file the cause of your possible error and google it.
I got the same error. How I resolved it was that the port no. assigned to wampmysql was 3306 which was used by another service, so right clicking on wamp icon->tools->use a port other than 3306(under port used by mysql)->change port no. say 3310->press enter. And icon turned green and started working.
Hope it helps.

mysql in xampp starts and stops in five seconds

I installed xampp in windows XP. I am able to start apache and tomcat. But when I start mysql, it gets started but stops after five seconds.
So, I am not able to work with PHPMyAdmin.
I checked the mysql_error file inside xampp/mysql/bin and the following was present.
120320 11:48:44 [Note] Plugin 'FEDERATED' is disabled.
120320 11:48:44 InnoDB: The InnoDB memory heap is disabled
120320 11:48:44 InnoDB: Mutexes and rw_locks use Windows interlocked functions
120320 11:48:44 InnoDB: Compressed tables use zlib 1.2.3
120320 11:48:45 InnoDB: Initializing buffer pool, size = 16.0M
120320 11:48:45 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file C:\xampp\mysql\data\ibdata1 did not exist:
InnoDB: a new database to be created!
120320 11:48:45 InnoDB: Setting file C:\xampp\mysql\data\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
120320 11:48:45 InnoDB: Log file C:\xampp\mysql\data\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file C:\xampp\mysql\data\ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
120320 11:48:45 InnoDB: Log file C:\xampp\mysql\data\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file C:\xampp\mysql\data\ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
120320 11:48:48 InnoDB: Waiting for the background threads to start
120320 11:48:49 InnoDB: 1.1.8 started; log sequence number 0
120320 11:48:52 [Note] Event Scheduler: Loaded 0 events
120320 11:48:52 [Note] mysql\bin\mysqld.exe: ready for connections.
Version: '5.5.16' socket: '' port: 3306 MySQL Community Server (GPL)
I am using xampp 1.7.7
please help...
This worked for me,
quit the XAMPP
cut the All files in C:\xampp\mysql\backup
paste and replace files in C:\xampp\mysql\data
run as administrator the XAMPP
i had the same problem and i have found a temporary solution by going to the installation folder
xampp->mysql->bin-> mysqld.exe file
running the mysqld.exe file
my xampp mysql service restarted successfully
I'm not sure if this will also work for your case, but it surely did for me, and I've yet to encounter the answer here.
go to Xampp/mysql/bin/my.ini
add the following line:
innodb_force_recovery = 1
(I think anything > 0 works here, also... it might be handy to make a backup of the file just to be on the safe side.)
You should now be able to successfully start your mySQL service.
This is an alternate solution instead of solving the above problem. I think you used windows installer for xampp, instead of that Download the zip file and keep it under c:\xampp. Use this link for downloading in zip format.
http://www.apachefriends.org/download.php?xampp-win32-1.7.7-VC9.zip
If you feel the zip file format is huge. Use 7zip file format.
http://www.apachefriends.org/download.php?xampp-win32-1.7.7-VC9.7z
Earlier I used to have same problem, solved it in this way.
Did you by any chance update your old install and then copy/paste your old 'htdocs' and 'mysql data' files to the upgrade files?
Have just run into the same problem, which I solved by uninstalling then re installing. Copying only my Htdocs over then re building my database... A pain but as I am only in Development and using Symfony2 rebuilding my database with fixtures was pretty painless.
Hope this is of some help.
Doug.
I had a similar problem that was caused by the TCP port needed for one for the services already being used by another application. In my case it was Skype using ports 80 and 443 as fall-back.
You can check if any of the needed TCP ports are used by another application by running the following at the command prompt:
c:>netstat /a
The offending connection will be listed as "LISTENING" in state STATE column. Then it's up to you to figure out what application is using the port. There is a nice tool called portmon for that.
The ports you'll need are 80, 3360... (anyone can expand on this?)
This is how I solved it:
xampp control panel > config > service & port settings > apache > mainport > 80 (default) change to 81.
open xampp > apache > cnonf > httpd.conf
3 search for ServerName localhost:80 change to ServerName localhost:81
search for Listen 80 change to Listen 81
Start Xampp > apache
open http://localhost:81/phpmyadmin/
whoaa its working
This worked for me, actually checking the 'mysql' service is not disabled. Turns out it was disabled.
how to check?
windows + R (opens run window)
type in services.msc
check if the service mysql is set as disabled. (change it to automatic)
This helped me with my unknown Phpmyadmin not starting issue.
If nothing helps, follow the steps mentioned in the below link. There are 3 methods to solve the problem. I hope, it will help you as well :)
For your convenience, I am writing down the steps of one of the methods which helped me to solved the problem
First of all stop all the services running in xampp control panel
Go to xampp > mysql >
Rename the data folder to anything else, such as data-old.
Then rename the backup folder to data
That's it. Try starting apache and mysql services from xampp control panel. Go to the link mentioned below to learn more.
https://kinsta.com/knowledgebase/xampp-mysql-shutdown-unexpectedly/