Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL errors 1

Status
Not open for further replies.

frozenpeas

Technical User
Sep 13, 2001
893
CA
I am running RH7.

When I run safe_mysqld, I get this:

Code:
[6] 2736
[root@scout /]# Starting mysqld daemon with databases from /var/lib/mysql
020713 11:23:52  mysqld ended

and this appears in the error log:

Code:
020713 11:14:27  mysqld started
020713 11:14:27  /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errn$
020713 11:14:27  mysqld ended

That file is located here: /var/lib/mysql/mysql/host.frm

If I try to login to MySQL, I get:

Code:
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

Any ideas? Thanks.
 
Anyone? I'm pulling my hair out here. This is ridiculous.
 
hi

the mysql daemon cannot find file from his own database "mysql" so it wont start - therefore the can't connect error
try tu run the mysql_install_db script - but u will loose any data in the mysql database, i suppose

hope that helps
 
chmod 777 /var/lib/mysql

This will give the daemon permission to open /var/lib/mysql/mysql.sock (effectively it starts up and needs permission to copy the .sock file to /tmp)
______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Oh, have you tried from the command line :>
mysqld restart

You may need the full path, I think the default is /etc/rc2.d/init.d/mysqld restart

You should get messages like:
shutting down mysql [failed]
starting mysql
errors n stuff [OK /failed]
errors if fail.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
When I try to restart /usr/bin/mysql:

Code:
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

and when I do /etc/rc.d/init.d/mysqld restart
Code:
Shutting down MySQL server                                 [FAILED]
Starting MySQL:                                            [  OK  ]

 
THANKS FOR ALL I HAD EXACTLY THE SAME PROBLEM FOR 3 DAYS WITH REDHAT 7.

AND I MANAGE TO RESOLVE IT.

Be careful i have launched before "mysql_install_db" (root). And before i made the chmod 777 to /var/lib/mysql, /var/lib/mysql/mysql, /var/lib/mysql/mysql.sock.

When u did "/etc/rc.d/init.d/mysqld restart" it's normal to say failed with shutting down because it wasnt started.

But in fact u didnt get it but it works after the command because it says Starting MySQL is OK.

And u can easily check it by doing "mysqlshow" or "mysql -u root -p" and tape enter when it asks password.
After u get the prompt mysql> tape "show databases;".
Or u can check if its working by doing "ps".
U should see safe_mysqld running.

My conclusion is that the redhat 7.3 installation do not give a good /etc/my.cnf file to use safe_mysqld.
 
So... why am I still getting this:

Code:
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

frozenpeas
 
After starting mysql coorectly
/etc/rc2.d/ini.d/mysqld start (or restart)

and typing mysql at the prompt, is that when you get your error?

If so check the directory properties for /var/lib/mysql

cd /var/lib
ls -l|more (hit enetr to page through until you find the listing for mysql directory which should look like: drwxrwxrwx on the left hand side

if it doesn't then do chmod 777 mysql
then type mysql -uroot -p

eneter your password (oh and be logged in as root when doing ALL of this.)
password: <your password> ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
When I enter my password I get:

Code:
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

I don't even know if the password has been successfullly set because all I have ever gotten is that error.

Thanks for all your help, by the way.
 
Does the file mysql.sock exist? (It is created with the Install script).

did u do ? chmod 777 /var/lib/mysql/mysql.sock ?

When he asked the password u dont have to tape anything, just enter because the default password is nothing.
 
frozenpas /usr/bin/mysql is the console application for accessing mysql server

use the startup script as KarveR was posting, something like &quot;/etc/init.d/mysql start&quot; or &quot;/etc/rc.d/init.d/mysql start&quot;

then do
ps ax | grep mysql

if the output is something like this

19221 ? S 0:00 /bin/sh /usr/local/mysql/bin/safe_mysqld --default-ch
19251 ? S 0:00 /usr/local/mysql/bin/mysqld --defaults-extra-file=/us
19253 ? S 0:00 /usr/local/mysql/bin/mysqld --defaults-extra-file=/us

your server is up and running

then locate your mysql.sock file, if it's in some other location than the apps are looking for, create/change /etc/my.cnf file and add there in the client section &quot;socket = /path/to/mysql.sock&quot;

but if there is still that host.frm prob, i'm almost sure u won't be able to start the server

zolty - mysql.sock is created on daemon start not during install
 
Yes, my permissions on mysql.sock are 777.

My /etc/my.cnf is empty. From what I have read (including in the forum) that is normal.
 
well, that's ok
try to put there this and restart mysql

[root]# cat my.cnf
[client]
socket = /var/lib/mysql/mysql.sock
[mysqld]
socket = /var/lib/mysql/mysql.sock

hope that helps
 
Are your permissions on the directory containing mysql.sock 777 ? <-- this is important!!!!! ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Nope, same errors.

I also tried copying a sample my.cnf file to /etc and am still getting the same thing.

Boy, this is fun.
 
Totally out unless you wanna alow me telnet acces to take a peep. ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Can you post an email address so I can send you the info?

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top