View Full Version : MySQL Problem
derekivey
3rd August 2005, 05:51 AM
Hi,
I just installed Fedora Core 4, and had chosen it to install MySQL. But, When I try to start MySQL, I get this error:
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]
Then, I tried typing service mysqld status and it gave me this:
mysqld dead but subsys locked
Does anyone know what's wrong? I even removed it and tried reinstalling with yum but the error still comes up and it won't start.
Thanks,
Derek
derekivey
3rd August 2005, 05:49 PM
Anyone??????
Furball
3rd August 2005, 06:02 PM
What does the command
/usr/bin/mysqld_safe --defaults-file=/etc/my.cnf
say ?
derekivey
3rd August 2005, 06:11 PM
It says:
Could not open required defaults file: /etc/my.cnf
Fatal error in defaults handling. Program aborted
Could not open required defaults file: /etc/my.cnf
Fatal error in defaults handling. Program aborted
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/lib/mysql/derekiveyhome.info.pid
050803 13:11:46 mysqld ended
Any ideas?
Thanks,
Derek
Furball
3rd August 2005, 06:26 PM
Somehow this configuration file has been deleted. I don't know if it's the only reason for your problems but this should be fixed.
This is strange as this file should be created if you re-install mysql.
Does
ls -l /etc/my.cnf
say file not found ?
The default file /etc/my.cnf contains:
(You can created it as well manually in a text editor)
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
[mysql.server]
user=mysql
basedir=/var/lib
[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
The permissions are -rw-r--r-- 1 root root
You could try the steps again then and see if your error messages change or disappear.
derekivey
3rd August 2005, 06:34 PM
Ok, that solved the problem but now I get a new error when starting mysql:
chown: cannot access `/var/lib/mysql\r': No such file or directory
chown: cannot access `/var/lib/mysql\r': No such file or directory
chmod: cannot access `/var/lib/mysql\r': No such file or directory
the directory /var/lib/mysql does exist.
Any ideas?
Thanks,
Derek
Furball
3rd August 2005, 06:46 PM
Seems that your complete mysql installation got messed up. Please try to re-install mysql the following way and see if your installation went well then:
1. Find all currently installed mysql packages:
rpm -q mysql mysql-server mysql-devel
sample output:
mysql-4.1.12-2.FC4.1
mysql-4.1.12-2.FC4.1
mysql-server-4.1.12-2.FC4.1
mysql-devel-4.1.12-2.FC4.1
2. For every listed package do a remove:
rpm -e mysql mysql-server mysql-devel
3. Reinstall the listes package via yum
yum install mysql mysql-server mysql-devel
derekivey
3rd August 2005, 06:49 PM
It says this message when I try to remove them:
error: Failed dependencies:
libmysqlclient.so.14 is needed by (installed) dovecot-0.99.14-4.fc4.i386
libmysqlclient.so.14 is needed by (installed) perl-DBD-MySQL-2.9007-1.i386
libmysqlclient_r.so.14 is needed by (installed) MySQL-python-1.2.0-1.i386
mysql is needed by (installed) MySQL-python-1.2.0-1.i386
Should I also remove MySQL-python too?
Furball
3rd August 2005, 07:04 PM
You have to make sure that you reinstall both packages: mysql mysql-server
(have to leave the computer for a few hours so cannot help you for some time :)
derekivey
3rd August 2005, 08:08 PM
:( I did that and still haev the same problem and my.cnf exists.
Firewing1
3rd August 2005, 08:15 PM
Try this: (as root) NOTE: You will lose all current DB's . Backup if they're important.
rpm -qa | grep -i mysql
rpm -e (pkgname)
pkgname is the result of the rpm -qa command. Repeat for each package if multiple come up.
Go to the MySQL site, and get all the Linux RPMS for MySQL 4.1.11. Download them to the same directory.
cd /path/to/saved/RPM/files
mkdir /var/lib/mysql
chmod 775 /var/lib/mysql
rm -drf /var/lib/mysql/*
rpm -Uhv mysql*.rpm
rpm -Uhv MySQL*.rpm
chown mysql.root /var/lib/mysql
/sbin/chkconfig on
reboot
Now, once you computer has restarted, the MySQL server should be running....
Firewing1
SharedMedia
3rd August 2005, 08:18 PM
I read this thread and started to cry... you didn't have to chmod, chown anything... it was the actual MySQL files that were "misconfigured" during rpm install / setup...I would suggest the following...
Clean up the MySQL issue the following command:
root@... > yum remove mysql*
then install fresh MySQL... the daemon and the client, and its counterparts (yum will install all deps)
root@...> Yum install mysql-* mysql
then follow this tutorial, to guarentee a successfull database install :)
Article: Securing MySQL: step-by-step
URL: (Fedora Forum) http://forums.fedoraforum.org/showthread.php?t=61618
OR.. after re-installing....Try adding the following to your MY.CNF, because the current MySQL 4.10a and 4.11 have INNODB resources, and sometimes doesnt work, preventing mysql to start.. we don't need INNODB or Berkly (BDB) support... well I don't :)... Open your MY.CNF and add these 2 lines.. save and restart MySQL
[mysqld]
skip-bdb
skip-innodb
Then restart mysqld > root@... > service mysqld restart...
Still stuck? read here http://forums.fedoraforum.org/showthread.php?t=61618 and here: http://forums.fedoraforum.org/showthread.php?t=66757
derekivey
3rd August 2005, 09:09 PM
Thanks,
I got it working, right after I posted the above post lol.
Derek
Salman
28th January 2007, 11:15 AM
Thanks!
I dont know how it worked, cause I lost the track of steps that I took.. BUT FINALLY IT WORKED!!
actually I installed fedora core 6 yesterday, before that I used WinXP and I had NetServer software on it which installed apache,php,mysql,phpmyadmin itself..
I had alot of data in mysql and in my www directory at win_xp partition and I was thinking that I might want to go back to XP for some little things so I should keep my data there so that I can work on them from any OS (XP/FC)
so after installing apache and mysql I edited httpd.conf I think to move www directory to my mnt point (mnt/win_e/server/www) it started working
then I tried moving mysql data directory from my.cnf and when I restarted mysql it started giving all sort of permission problems.. I tried fixing them.. but couldnt understand what to do.. then from nowhere a client popped up and I had to do something urgently for him so I moved my data to mysql data folder thinking that I will fix it later.. and forgot to remove mysql and test tables before moving.. so the settings got overwritten and mysql crashed.. since then I have removed and installed mysql 5 times!!
anyways it's working now.. and I am happy again, thanks!!
once I am trhough with some projects I will come here again to find out how I can move mysql data directory like I moved apache www directory :( I know it can be done!! just short of time,
Thanks once again,
-Salman
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.