Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Hello Everyone. Here is my story... My server went out on me 5 hours ago... and I'm still infront of my computer trying to see what's going on. I figure it's the MySQL. Everytime i enter this command..
Quote:
root@myBox root]# service mysqld start
or
root@myBox root]# service psa start
I recieved this...
Quote:
root@myBox root]# env: /etc/init.d/mysqld: No such file or directory.
or
root@myBox root]#ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
I talk with my server provider... Godaddy.... and their advice is to pay extra $50 so they could erase my files... and restart everything over again...cough...get another server. What kind of support is this?
Anywayz, I've try configuring the my.cnf file and the mysqld in /etc/init.d ... and it still doesn't work. Is there anywayz i can get Mysql to work again? and How?
I'm on Fedora Core 2... Mysql is 3.23 .... Plesk 7.5 reloader... Apache ...
Here's my current mysqld file.
Code:
#!/bin/bash
#
# mysqld This shell script takes care of starting and stopping
# the MySQL subsystem (mysqld).
#
# chkconfig: - 64 36
# description: MySQL database server.
# processname: mysqld
# config: /etc/my.cnf
# pidfile: /var/run/mysqld/mysqld.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
prog="MySQL"
datadir="/var/lib/mysql"
start(){
touch /var/log/mysqld.log
chown mysql:mysql /var/log/mysqld.log
chmod 0640 /var/log/mysqld.log
if [ ! -d $datadir/mysql ] ; then
action $"Initializing MySQL database: " /usr/bin/mysql_install_db
ret=$?
chown -R mysql:mysql $datadir
if [ $ret -ne 0 ] ; then
return $ret;
fi
fi
chown -R mysql:mysql $datadir
chmod 0755 $datadir
/usr/bin/safe_mysqld --defaults-file=/etc/my.cnf >/dev/null 2>&1 &
ret=$?
# If you've removed anonymous users, this line must be changed to
# use a user that is allowed to ping mysqld.
ping="/usr/bin/mysqladmin -uUNKNOWN_MYSQL_USER ping"
# Spin for a maximum of ten seconds waiting for the server to come up
if [ $ret -eq 0 ]; then
for x in 1 2 3 4 5 6 7 8 9 10; do
if [ -n "`$ping 2> /dev/null`" ]; then
break;
else
sleep 1;
fi
done
if !([ -n "`$ping 2> /dev/null`" ]); then
echo "Timeout error occurred trying to start MySQL Daemon."
action $"Starting $prog: " /bin/false
else
action $"Starting $prog: " /bin/true
fi
else
action $"Starting $prog: " /bin/false
fi
[ $ret -eq 0 ] && touch /var/lock/subsys/mysqld
return $ret
}
stop(){
/bin/kill `cat /var/run/mysqld/mysqld.pid 2> /dev/null ` > /dev/null 2>&1
ret=$?
if [ $ret -eq 0 ]; then
action $"Stopping $prog: " /bin/true
else
action $"Stopping $prog: " /bin/false
fi
[ $ret -eq 0 ] && rm -f /var/lock/subsys/mysqld
[ $ret -eq 0 ] && rm -f $datadir/mysql.sock
return $ret
}
restart(){
stop
sleep 2
start
}
condrestart(){
[ -e /var/lock/subsys/mysqld ] && restart || :
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status mysqld
;;
restart)
restart
;;
condrestart)
condrestart
;;
*)
echo $"Usage: $0 {start|stop|status|condrestart|restart}"
exit 1
esac
exit $?
Sorry I should have posted this originally: I think this was abandoned in version 3 but also try safe_mysqld & (typed the other way around, the & just backgrounds the process). Normally, though, the two commands are symlinked for backwards compatibility, so it's odd that it wouldn't find it.
When you say your server went down you mean your webserver? You've had mysql running correctly before right?
nah... the web server is fine. It's just the mysql server. I can't get it start. Without the mysql server running... all of the websites that I currently host are currently down.
root@gateway:/var/lib# mysqladmin status
Uptime: 7348 Threads: 1 Questions: 102 Slow queries: 0 Opens: 8 Flush tables: 1 Open tables: 1 Queries per second avg: 0.014
I have a feeling tht your mysqld may have died but left a sock and lockfile which makes new mysqlds think it's still running. If the above command gets you output like this
Code:
root@gateway:/var/lib# mysqladmin status
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysql/mysql.sock' exists!
...then delete the socket and lockfile and try restarting mysql again:
On a side note: Please don't mark your threads as urgent, be considerate to the thousands of others that ask questions and then the members that come here in their own free time to help members. No members questions has a higher priority than the other, marking your threads as urgent does nothing to get answers faster.
On a side note: Please don't mark your threads as urgent, be considerate to the thousands of others that ask questions and then the members that come here in their own free time to help members. No members questions has a higher priority than the other, marking your threads as urgent does nothing to get answers faster.
I apologize.
I type in "mysqladmin status"... and I got...
Quote:
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysql/mysql.sock' exists!
But... I can't locate the sock file or the lock file. How can I do that? I manage to get a reply from Godaddy... and here's what it said.
Quote:
Our administrator has looked into the issue with your Dedicated server configuration. It appears that you have installed MySQL-server-4.0.21-0.i386
This version of mySQL is incompatible with the Plesk management system as it uses a different syntax than earlier versions. You might attempt to roll that install back to an earlier version of mySQL to repair your issue. If you wish for us to make the change for you, we will need to charge an Expert Hands fee.
Should you require further assistance on this or any other issue, don't hesitate to contact us any time of the day or night at (480) 505-8877. Or, if you prefer email, you can send your questions or comments to support@supportwebsite.com.
Thank for all your help michaelsanford. Hmmm... I just notice that Plesk is compatiable with MYSQL version 4. It looks like my best option right now is to repartition the whole server... and start everything over again. I have to wonder myself... how did this happen? All I did is reboot. Darn it!!!
Ha! Ha! Ha! Sorry guys.. I have to laugh at myself for this one. I was about to gave up... and reformat the server..... but before doing that... I decided to just type all mysql commands that was in my head. And guest.. what? It work now. Lolz. Mother fucking MySQL work now. Wierd.. thing is i don't remember which command get it to work... I mean I tried everything.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.