I have been running a Turnkey LAMP appliance on Virtualbox on Win 7 for several months for web development.  However today for some reason the MySql instance failed to start.  The Apache web server is running and pages that do not access the database are OK.  However I am unable to access the administration pages (Web Shell, Webmin, and Adminer) presumeably because they use the MySql database..

On start up the Debian screen tells me  - Failed to start LSB: Start and Stop  MySql database server daemon, "See systemctl mysql.service for details"..

I now have at least three questions:

1.  How can I get the MySql instance to start.

2.  If I can't how do I get access to the Web Server files in the VM.

3. Is it possible to access the Debian Linux core and get access to the files, and or load or reload the MySql database.

4. If I could see/find sytemctl where is and what could I do with the information.

Forum: 
Jeremy Davis's picture

It sounds like something has seriously gone wrong!

Neither Web Shell nor Webmin use MySQL, so that suggests your problem is deeper than just MySQL.

I'm totally jumping to conclusions, but the first thing I'd think is you've run out of RAM. The Linux kernel has a thing called OOM-Killer (Out Of Memory Killer) which will start killing services when the memory runs too low.

The idea is that it will kill processes to try to keep the core system stable. Whilst in some ways that's a good thing, although unfortunately MySQL seems to be a common target for the OOM-Killer, which is rarely very handy...

Having said that, a reboot should restore things to a working state (at least temporarily - until it runs out of RAM again). Although you didn't explicitly say that you have tried that, I'm guessing that you have. So my next random guess is that you've run out of free space on your (virtual) hard drive. To see if that's the case, try running this command:

df -h

That should show you how much free space you have. Feel free to post the results if it doesn't make any sense to you. For further troubleshooting, I suggest checking the journal So to troubleshoot this further, I suggest that you check the commands that the error message is suggesting. More on that below.

To answer your explicit questions:

1. I recommend using the 'service' command from the terminal. If SSH is running then you can log in via that and use a remote shell. Otherwise, you should be able to use the VM window to access the shell. The service command works like this:

service SERVICENAME COMMAND

The COMMAND can be one of (usually) start, stop, status and restart (i.e. stop and start). So to start MySQL:

service mysql start

2. Is this question related the issues you are having, or a more generic question? The web server files should be in /var/www (or a sub-directory, depending on the specific server you are using). Although chances are, at least some of the info is actually in the DB (database - i.e. MySQL).

3. If SSH is running you can log in via SFTP and download your files, not worries. If not, then you might have problems...

4. Again you'll need shell access. But essentially it's just a case of typing in the suggested command. So in this case:

systemctl mysql.service

FWIW that should give you similar output to:

service mysql status

It will probably only give you a little info there, but it will provide another command you can use for more info (I forget what it is off the top of my head sorry but it should be displayed).

I hope that helps.

Add new comment