Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi everyone. I am running Ubuntu Feisty Fawn 7.04 Desktop. I am using it as a LAMP server for some hobby pages (A blog, pictures of my baby, etc.). It has some bad RAM that makes it freeze up every once in a while (1-2 times a month). I usually just put up with this, as it just requires a restart of my machine. The trouble is, when this happened most recently, my mysql server failed to start (silently). I noticed a few days later when I tried to access my blog and got an error. I used ssh to check on my machine, and sure enough, mysql was not running. In fact, even with /etc/init.d/mysql start, the result I got was: "failed". I' tried dmesg | tail and I also tried looking at /var/log/mysql.err and /var/log/mysql.log, but both seemed to be empty. Being set up just for the fun of it, I didn't think to backup my server (I know, stupid, and I promise I will back it up regularly if I can get it back up and running). Anyway, I'd love to get it back up and running, but I'm at a loss. I really don't want to reinstall mysql, because that means that I'd have to re-setup all of my LAMP applications. Any ideas?
Distribution: Debian Based only but have tried most others.
Posts: 82
Rep:
Try to restart mysql and double check that nothing is showing up in the syslog or the mysql logs. Without any leads my gut instinct says you have a corrupt table that happened during the hard boot. This should be helpful:
Thank you both for your answers. I tried killing all of the PID's and then restarting - still no luck. var/log/messages held no answers (no mention of mysql there). myisamchk is VERY cool. I really like it, and I'll tuck this tool away in my brain. Unfortunately, even after I run it with the -r option, I still can't start mysql. I have a question: If I backup my data directory and reinstall mysql, and then put my old data into the new data directory, will my databases come back, or would that not work?
Distribution: Debian Based only but have tried most others.
Posts: 82
Rep:
Generally speaking yes they will and I have done that process exactly. If you have a SQL dump thats better but copying the tables by hand has worked for me in the past. The mysql hotcopy makes a physical copy, it just makes sure no transactions are happening. If your using binary logs that may cause issues but most likely you will be fine as I think that only happens when syncing between databases.
For testing purposes I would first backup all the files. For time sake you can try to reinstall.
apt-get --reinstall install packagename
if that does not work I would try a purge (make sure the tables are not left in the directory). Do an install. Then see if it starts. If it starts stop mysql, copy the tables back and then restart and see what happens (make sure permissions are correct on the tables).
Well, progress...I suppose. I went to run Synaptic, and (upon getting an error message) I realized my problem: I was running Ubuntu Update when my system froze. That's what clobbered my mysql install. I tried backing up my data files and reinstalling, but still got errors:
Code:
dmay@mayfamily:~$ sudo dpkg --configure -a
Setting up mysql-server-5.0 (5.0.38-0ubuntu1.1) ...
* Stopping MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "stop" failed.
* Starting MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.0 (--configure):
subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.0; however:
Package mysql-server-5.0 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.0
mysql-server
Wow, I am at a loss. I did an apt-get purge mysql-server mysql-server-5.0 (after backing up my data directory) and still got "invoke-rc.d: initscript mysql, action "start" failed". Thinking that maybe my hard crash had corrupted a .deb download, I cleared /var/cache/apt/archives/. This time, when I ran apt-get install mysql-server mysql-server-5.0, it downloaded the .deb file again. Unfortunately, it still fails, just like before.
Tried the aptitude update/aptitude-upgrade last night. Here is all of my command line output from the upgrade:
Code:
aptitude upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Setting up mysql-server-5.0 (5.0.38-0ubuntu1.1) ...
* Stopping MySQL database server mysqld [ OK ]
* Starting MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "start" failed.
(Hangs here, a CTRL-C moves it along...)
Code:
dpkg: error processing mysql-server-5.0 (--configure):
subprocess post-installation script killed by signal (Interrupt)
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.0; however:
Package mysql-server-5.0 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.0
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up mysql-server-5.0 (5.0.38-0ubuntu1.1) ...
* Stopping MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "stop" failed.
* Starting MySQL database server mysqld [fail]
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.0 (--configure):
subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.0; however:
Package mysql-server-5.0 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.0
mysql-server
Here's what dpkg-reconfigure does:
Code:
root@mayfamily:~# dpkg-reconfigure mysql-server
/usr/sbin/dpkg-reconfigure: mysql-server is broken or not fully installed
root@mayfamily:~# dpkg-reconfigure mysql-server-5.0
/usr/sbin/dpkg-reconfigure: mysql-server-5.0 is broken or not fully installed
A new version of Ubuntu came out today. I may try a dist-upgrade when my torrent finishes downloading, if no one has any ideas by then...
Thanks selva146, and especially Road for all of your help. I finally got my mysql server working. The Distro Upgrade did it. I tried the stuff in the Debian manual, but I was STUCK. The sad thing is that somewhere along the way, a couple of my databases got clobbered. Most of my databases, however, survived. Thanks again, guys!
Even just doing it to the same hard drive is better than nothing. Since you know your computer could go down at anytime your chances of messing your mysql up go up significantly. This way you could just copy the tables back over if you got actual corrupt files.
OK. I am backing up now that my server and databases are back up, as promised. I'm using MySqlAdmin to do it for now, because I know it well, and it was 1:30 am when I set it up last night and I wanted to go to bed. I looked at mysqlhotcopy and will probably shift to that soon. Thanks again.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.