MySQL is not working on PHP with Fedora 16

bruce badouglas at gmail.com
Mon Jan 23 19:02:46 UTC 2012


umm...

exactly what/how do you attempt to access mysql through the php app?
are you sure you used to exact same attributes when you access mysql from
the cli?
what do the mysql log files say?


On Mon, Jan 23, 2012 at 1:05 PM, Fedora Linux <fedoralinux at toursbymexico.com
> wrote:

> Hello
>
> By command line I am able to connect normally, so the problem is not
> MySQL... I use "mysql -u root -h localhost -p" and it works... Note that
> the application also uses root since it must create the database and a user
> for the application...
>
> I have tried to restart MySQL and the whole system, but it still does not
> connect from PHP
>
> The error is:
> [error] [client ::1] PHP Warning:  mysql_connect(): Can't connect to local
> MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in
> /var/www/html/install2.php on line 22, referer:
> http://localhost/install.php
>
> So I guess the problem is in the PHP, Apache or on the interface between
> MySQL and Apache/PHP...
>
> Any other suggestion?
>
> Regards
>
> On Sun, Jan 22, 2012 at 12:04 PM, bruce <badouglas at gmail.com> wrote:
>
>> hi...
>>
>> ok.. basic debug stuff.. skip if you've already done..
>> -using the user/passwd.. can you access mysql from the cmdline..
>>    [i assume you can]
>> -what are the permissions on the mysql db/tbls? have they changed?
>> --did you stop/restart mysql?
>> -what do the mysql logs say?
>>
>> let us know..
>>
>>
>> On Sun, Jan 22, 2012 at 12:28 PM, Mike Wright <mike.wright at mailinator.com
>> > wrote:
>>
>>> On 01/22/2012 07:02 AM, Fedora Linux wrote:
>>>
>>>> Hello
>>>>
>>>> I have a web application but it is not working on my Fedora 16 with PHP,
>>>> for some reason it is unable to connect to the MySQL server, it returns
>>>> the error:
>>>>
>>>> [Sun Jan 22 08:40:24 2012] [error] [client ::1] PHP Warning:
>>>>  mysql_connect(): Can't connect to local MySQL server through socket
>>>> '/var/lib/mysql/mysql.sock' (13) in /var/www/html/install2.php on line
>>>> 22, referer: http://localhost/install.php
>>>>
>>>> Notice that the user/password is correct, the PHP is installed and
>>>> working and MySQL is up and running...
>>>>
>>>> Even the socket is there
>>>>
>>>> # ls -l /var/lib/mysql/mysql.sock
>>>> srwxrwxrwx. 1 mysql mysql 0 Jan 22 08:37 /var/lib/mysql/mysql.sock
>>>>
>>>> What can be the problem? The application is okay, I am using it in a
>>>> production server and it is running in 2 other local computers (with
>>>> slackware) for testing purposes...
>>>>
>>>> This is the first time that I can't connect to MySQL via PHP... I don't
>>>> know if it requires an extra configuration or there is a missing package
>>>> that I should install... the httpd log does not give more details...
>>>>
>>>> Thanks for any help!
>>>>
>>>
>>> Do you have port 3306 open on your firewall?
>>>
>>>>
>>>>
>>>>
>>>>
>>> --
>>> users mailing list
>>> users at lists.fedoraproject.org
>>> To unsubscribe or change subscription options:
>>> https://admin.fedoraproject.**org/mailman/listinfo/users<https://admin.fedoraproject.org/mailman/listinfo/users>
>>> Guidelines: http://fedoraproject.org/wiki/**Mailing_list_guidelines<http://fedoraproject.org/wiki/Mailing_list_guidelines>
>>> Have a question? Ask away: http://ask.fedoraproject.org
>>>
>>
>>
>> --
>> users mailing list
>> users at lists.fedoraproject.org
>> To unsubscribe or change subscription options:
>> https://admin.fedoraproject.org/mailman/listinfo/users
>> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
>> Have a question? Ask away: http://ask.fedoraproject.org
>>
>>
>
> --
> users mailing list
> users at lists.fedoraproject.org
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
> Have a question? Ask away: http://ask.fedoraproject.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/users/attachments/20120123/fd0f4ddc/attachment-0001.html>


More information about the users mailing list