mysql is missing or will not start
Recently my Web guy has left and I know very little about Linux and MySQL so I am in desperate need of some advice.
Overnight the MySQL service has either corrupted or something sinister has happened. Not sure why, but there is no mysqld daemon in /etc/init.d. There is a daemon called mysql instead. However when I tried to start the daemon the following errrors appear: # service mysql restart /etc/init.d/mysql: line 182: cd: HOME not set /etc/init.d/mysql: line 182: cd: HOME not set MySQL PID file could not be found! [FAILED] /etc/init.d/mysql: line 182: cd: HOME not set Starting MySQL................................... [FAILED] Then I located mysqld in /usr/sbin/mysqld and so I ran it but the following occurs: # /usr/sbin/mysqld 050602 14:17:44 [Warning] Asked for 196608 thread stack, but got 126976 050602 14:17:44 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use 050602 14:17:44 [ERROR] Do you already have another mysqld server running on port: 3306 ? 050602 14:17:44 [ERROR] Aborting 050602 14:17:44 [Note] /usr/sbin/mysqld: Shutdown complete I also cannot find the config file "my.cnf" When I query mysql it also cannot detect it as follows: # rpm -q mysql package mysql is not installed I have researched on the topic and found some similar threads which advise to reinstall the MySQL, however I am fearful of damaging existing tables and data by my inexperience. what is wrong here? anyone? please help me.... thanks in advance guys! |
mysql is missing or will not start
Suspecting that my MySQL installation is screwed up, is there a way that I can check to see if the DB's are still in tact? or if they even exist?
How can I search for the DB's on my server? Very green on this subject so pls help! |
try this:
- connect to MySQL mysql -uUsername -pPassword once logged in type: show databases; - connect to a Database use DbName; - view tables of a Database (must be connected to the Database) show tables; - view contents of a table (must be connected to the Database) select * from TableName; |
I would indeed suggest to reinstall mysql.
if your worried for database loss use this: # Copy MySQL's data files and directories. For example, if your MySQL data directory is /var/lib/mysql and you want to save it to /tmp/mysql-backup: # cp -r /var/lib/mysql /tmp/mysql-backup Instead of cp, you can use rsync, tar, gzip, or other commands. once you placed the raw mysql database files in another file.. you can start removing mysql. then once everything is working again, stop mysql, place the files back in the propper directory. |
mysqldump
You can also try to dump the database with all it's contents and then check the dumpfile in an editor (works fine for small sized databases). You'll get an error if the database doesn't exist.
Code:
mysqldump database_name -u user_name --password='plaintext-password' > my_dump_file SIMP Fedora Development |
First find your MySQL installation (your output may be different):
Code:
$ which mysql Code:
$ ls -l /usr/local/mysql Some MySQL installations use 'mysql.server' as the launcher within /etc/init.d, using Code:
/etc/init.d/mysql.server start See how far this get's you. Typical follow-up errors can be with the socket-file, if the installation really is corrupted. Hope this helps, Regards, SIMP |
I merged your two closely related threads.
|
MySQL problem fixed another appears
Thanks to all who replied,
I realized that MySQL will not start when there is no disk space!!! I freed up some space and MySQL was happy except for some messed up indexes which I repaired. The new problem is that I am losing disk space and cannot find where/what is using it up so quickly... no matter how much I free up, within a few hours its used up again and services start to fail. Any ideas on this would be welcome.. thanks once again. |
Check out the cmds
du df to start with. you might also want to look at /var/log dir, where a lot of software put their logfiles. You can use ls -l to see the sizes, add the 't' switch to sort newest at the top ls -lt check also the Apache error_log and access_log if you have Apache. Here's a really good free online Linux tutorial: http://rute.2038bug.com/index.html.gz |
All times are GMT -5. The time now is 02:00 PM. |