Re: [PHP] PHP-MYSQL Error: Can't connect to MySQL socket. Can someonehelp me out please?

[email protected] ("Rahul P")
Newsgroups php.general
Message-ID <[email protected]>
Thanks. I just stopped mysql and when I try to start it again it throws
another set of errors:

chown: changing ownership of `/home-public/mysql6': Operation not permitted

So I guess something is messed up completely. I wish I installed it better.
Now the installing is messed up I guess with all sorts of bad files. I will
try Google now...

Thanks for the help... :)

On Sun, May 11, 2008 at 12:17 AM, Nathan Nobbe <[email protected]>
wrote:

> On Sun, May 11, 2008 at 1:05 AM, Rahul <[email protected]> wrote:
>
>> I have recorded both the errors by changing the variable:
>>
>> $host = "mycomputer.webaddress.com"
>>
>> PHP Warning:  mysql_connect(): Lost connection to MySQL server during
>> query in /export/home/rpo219/may/conf_global.php on line 18
>> Lost connection to MySQL server during query
>
>
> i have seen this before, but i cant recall, specifically what the problem
> could be.  i recommend google ;)
>
>
>> $host = "localhost"
>>
>> PHP Warning:  mysql_connect(): Can't connect to local MySQL server through
>> socket '/var/lib/mysql/mysql.sock' (111) in
>> /export/home/rpo219/may/conf_global.php on line 18
>> Can't connect to local MySQL server through socket
>> '/var/lib/mysql/mysql.sock'
>>
>
> i believe this is because the user root, does not have permission to
> connect to the datbase from host 'localhost', especially since you said this
> didnt work from the command line either.  you will have to add a grant
> clause to allow the root user to connect from the localhost.
>
> I found something weird for the first time:
>>
>> I tried looking at the mysql6 data directory and it says the following:
>>
>> total 28
>> drwxr-xr-x   3 nfsnobody nfsnobody 4096 May 10 23:57 .
>> drwxrwxrwx  21 root      root      4096 May  7 14:35 ..
>> -rw-rw----   1 nfsnobody nfsnobody 1009 May 10 23:57
>> mycomputer.webaddress.com.err
>> drwxr-xr-x   2 nfsnobody nfsnobody 4096 Jan 24 20:07 mysql
>>
>
> that is likely the way your distribution has designed the permission scheme
> for the mysql server.
>
> And when I try to change the ownership of the directory to mysql by
>>
>> [[email protected]] chown mysql ./mysql6
>> chown: changing ownership of `./mysql6': Operation not permitted
>>
>
> this is probly because you dont have permission to make the change...  you
> could do it via sudo, but i wouldnt recommend it.  your distro has set it up
> this way on purpose.
>
>
>> Just thought it might be related to the problem
>
>
> have you created any databases after installing mysql?  you should create
> at least one, like test db or something, and its good practice to create a
> specific user to access the database through as well.  instead of having php
> connect as root.  thats like a hackers dream right there.
>
> -nathan
>
>


-- 
Rahul
Computer Engineering and Systems Division.
Department of Electrical Engineering and Computer Science
Robert R. McCormick School of Engineering
Northwestern University
2145 Sheridan Road, Evanston,IL60208.

Administrator: The En?gma Project
Website: http://www.enigmaportal.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.