[PHP] Re: PHP-MYSQL Error: Can't connect to MySQL socket. Can someone helpme out please?
- Date: Sat, 10 May 2008 23:33:47 -0500
- From: Rahul <rahul986@xxxxxxxxx>
- Subject: [PHP] Re: PHP-MYSQL Error: Can't connect to MySQL socket. Can someone helpme out please?
By the way it installed MySQL 6 and PHP 5.0.4 and from the console this command does not work:
mysql -u root -p but only this works: mysql -h <hostname> -u root -pI tried doing the same while connecting to the database via php but it does not work.
Rahul wrote:
I am using Fedora Core 4. As I was unable to use PHP or MySQL together, I uninstalled both of them and installed again using the following commands:yum install mysql And thenapt-get install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagickAnd then started the mysql server. I am able to connect to the server from the console my typing mysql -h <hostname> -u root -p <mypass>However, when I try to connect to mysql through PHP I get the following errors:PHP Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /export/home/rahul/may/sample.php on line 5 PHP Warning: mysql_query(): A link to the server could not be established in /export/home/rahul/may/sample.php on line 5 Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)Can someone please help me out?
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- References:
- Prev by Date: [PHP] Re: Division [maybe a bug]
- Next by Date: Re: [PHP] PHP-MYSQL Error: Can't connect to MySQL socket. Can someone help me out please?
- Previous by thread: [PHP] PHP-MYSQL Error: Can't connect to MySQL socket. Can someone help me out please?
- Next by thread: Re: [PHP] PHP-MYSQL Error: Can't connect to MySQL socket. Can someone help me out please?
- Index(es):