PDA

View Full Version : My SQL Error creating DB


rszkutak
12-27-2003, 04:16 AM
Hey all,
I am new to the MySql area, so go light on me here ! :)

Anyway, I am creating a DB on RH 7.3 runnign the most curent version of DA. I am gettin an error on a customers site. This is what it reads EXACTLY. Does anyone have an idea of what this is and or how to address it ?

I treid to create a sample DB on other sites as well, to no avail. I get the same "cannot connect to SQL error" Although the MySQL 4.0.16 shows up as available, i somehow either question the connetion, or MySQL is lying to me !!!!



-Rob


Error creating the database


Error connecting to MySQL: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Error connecting to MySQL: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

DirectAdmin Support
12-27-2003, 11:31 AM
Hello,

You'll first need to check the mysql is running.. but generally we can assume it is or else you'll be getting emails. So what's probably happening is that the mysql.sock file is located somewhere else. The location will might be specified in the /etc/my.cnf file. The only 2 places I've ever seen the mysql.sock file is in /var/lib/mysql/mysql.sock or /tmp/mysql.sock.. so you can have a look in /tmp to see if that files exists. If it does then it's probably just a matter of either change the settings in /etc/my.cnf (if it exists), or else just creating a symbolic link to the correct socket file:ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sockJohn

rszkutak
12-27-2003, 05:06 PM
John,
Thanks for the reply... I logged into SSH with my root account and ran what you said. Honestly it sounded like exactly what is happeneing there.

That command ran correctly, but didn't solve the problem. I have to say that I am very much a UNIX novice, and command line..... OMG that is like going to a foreign country and not even knowing where you are. Sorry I am a massive Windows guy, but Windows, we'll we just won't go there for security reasons now will we??? or let alone e-mail ! If i could just manage to load a GUI, then I would be lots better.... sad, very sad i know.

How can I find out loggin in with SSH, where to locate that file if it even exists?

Sorry but my unix skills are very rough, I haven't admin'd a unix box in about 6 years now so I am very rusty.

This machine is a brand new install of RH 7.3, using the most current version of DA. Right now it has only been up about 4 days, it's that new.

Yours or anyones guidance is greatly apprecaited.

-Rob

rszkutak
12-27-2003, 06:42 PM
I did a locate on the /var/lib/mysql and this is what i found.

I also did a look in the /tmp file and found nothing with a .sock after it. DA shows that MySql is running, so i suspect it is indeed up.

locate /var/lib/mysql
/var/lib/mysql
/var/lib/mysql/mysql
/var/lib/mysql/mysql/db.frm
/var/lib/mysql/mysql/db.MYI
/var/lib/mysql/mysql/db.MYD
/var/lib/mysql/mysql/host.frm
/var/lib/mysql/mysql/host.MYI
/var/lib/mysql/mysql/host.MYD
/var/lib/mysql/mysql/user.frm
/var/lib/mysql/mysql/user.MYI
/var/lib/mysql/mysql/user.MYD
/var/lib/mysql/mysql/func.frm
/var/lib/mysql/mysql/func.MYI
/var/lib/mysql/mysql/func.MYD
/var/lib/mysql/mysql/tables_priv.frm
/var/lib/mysql/mysql/tables_priv.MYI
/var/lib/mysql/mysql/tables_priv.MYD
/var/lib/mysql/mysql/columns_priv.frm
/var/lib/mysql/mysql/columns_priv.MYI
/var/lib/mysql/mysql/columns_priv.MYD
/var/lib/mysql/test

Any thoughts on this ?

ProWebUK
12-28-2003, 05:24 AM
Can you log into phpmyadmin view databases etc?

Chris

DirectAdmin Support
12-28-2003, 01:23 PM
You could always try creating the /etc/my.cnf file with the following data:
[mysqld]
socket=/var/lib/mysql/mysql.sock

or even do a "locate mysql.sock" to find the socket. (You should actually run "updatedb" first to make sure the locate command is using the latest data.)

John

overhosted
02-04-2004, 12:17 PM
I know it's a old topic, but i have the same problem...

But all the replies didn't work....

Does someone have another idea?

overhosted
02-05-2004, 07:14 AM
anyone? :(

DirectAdmin Support
02-05-2004, 11:26 AM
Hello,

Is mysql running? are you getting a connect error, or a invalid username/password error. What OS are you using. Check /usr/local/directadmin/conf/mysql.conf and try out that user/pass in phpmyadmin. If MySQL isn't running, try starting it, or else check /var/lib/mysql/<hostname>.err to find out why it's not loading.

John

overhosted
02-05-2004, 11:39 AM
Hello,

Well, i solved it...

Just for anyone who has the same problem:

In my case mysqld wasn't responding to shutdown (it said there was a procces running on the same port)

So i checked out which pid's mysql was using at that moment:

Type in ssh:

# ps -A | grep mysql

Kill all the pid files

using:

#kill <pid number>

And then just restart mysqld.. (# service mysqld start)

I hope its a bit clear.

Thanks,

Kevin