PHP MySql under Linux

I am extreme newbie for linux and received this error when I try to run MySql.

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

On google, I found that this error can be removed by altering mysql.sock / my.cnf file. But I dont find those files anywhere! I dont know if I have installed MySql successfully!
LVL 2
sangeethaAsked:
Who is Participating?
 
_Marcel_Commented:
Independent of the version you are running you have a problem with the location where your mysql-socket is placed. PHP is looking in a different location than MySQL is putting the socket. This you can solve by pointing PHP to the right location (although I'm not sure how) or putting the MySQL-socket in the right location by starting mysql as follows:

/path/to/your/mysqld --socket=/var/lib/mysql/mysql.sock

Don't forget to put the right path there!

Good luck
0
 
alextr2003frCommented:
to know if you have mysql installed use
<?
phpinfo();
?>
check the results and see if you have mysql in it
0
 
sangeethaAuthor Commented:
Ok, It seems my FedoraCore2 defaultly have the MySQL 3.23 package!, anyone know how to upgrade the version automatically?
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
alextr2003frCommented:
I'd advice you to upgrade it following the official guidlines as described here :
http://dev.mysql.com/doc/mysql/en/linux-rpm.html
0
 
alextr2003frCommented:
also try to read this since the person is trying to do same as you :
http://forums.fedoraforum.org/showthread.php?t=49203
0
 
matt_mcswainCommented:
sangeetha, is mysql started?
/usr/bin/safe_mysqld &

Is it running under root?
ls -la /usr/bin/safe_mysqld
0
 
sangeethaAuthor Commented:
I got this:
=========================================================================================
[root@localhost/localdomain root]# /usr/bin/safe_mysqld
touch: cannot touch `/var/lib/mysql/localhost/localdomain.err': No such file or directory
chown: cannot access `/var/lib/mysql/localhost/localdomain.err': No such file or directory
Starting mysqld daemon with databases from /var/lib/mysql
/usr/bin/safe_mysqld: line 311: /var/lib/mysql/localhost/localdomain.err: No such file or directory
/usr/bin/safe_mysqld: line 317: /var/lib/mysql/localhost/localdomain.err: No such file or directory
STOPPING server from pid file /var/lib/mysql/localhost/localdomain.pid
tee: /var/lib/mysql/localhost/localdomain.err: No such file or directory
050414 23:11:17  mysqld ended
tee: /var/lib/mysql/localhost/localdomain.err: No such file or directory
=========================================================================================

Will myssql will be uninstalled with this commands?

[root@localhost/localdomain root]# rpm -e MySQL-server-4.1.11-0
[root@localhost/localdomain root]# rpm -e MySQL-client-4.1.11-0

Any help is much appreciated!
0
 
alextr2003frCommented:
if you have MySQL 3.23 then maybe something like : rpm -e MySQL-server-3.2.... would be more appropriate.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.