• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 375
  • Last Modified:

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!
0
sangeetha
Asked:
sangeetha
3 Solutions
 
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
 
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
_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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now