SQL Problems

AZ Pete plug-discuss@lists.plug.phoenix.az.us
Fri, 22 Mar 2002 12:32:05 -0800 (PST)


I ran into this problem as well. It turned out to be a mysql security
issue with the grant tables.
When I specified the hostname (rather than 'localhost') everything
worked OK.  You may want to check the users table to make sure the
entry for root has the proper hostname entered.

Also, since your not specifying a password ensure that the root user
does not have a password in the grant tables (generally not a good
thing to do).

Hope this helps,
Peter
--- "A.P. Etc" <ap_etc@yahoo.com> wrote:
> I have mysql installed and running what appears to be fine. I created
> a
> database, added a table to it with no problems. I also have php up
> and
> running on my apache server, I did a quick "hello world" as a test.
> In spite
> of all this, it appears to have a problem connecting to the database.
> 
> It uses this code in the PHP tags:
> 
> $db = mysql_connect("localhost", "root");
> mysql_select_db("test",$db);
> 
> And I'm getting this error in my browser:
> 
> Warning: Can't connect to local MySQL server through socket
> '/var/tmp/mysql.sock' (111) in /usr/local/apache/htdocs/phptest.php
> on line
> 24
> Warning: MySQL Connection Failed: Can't connect to local MySQL server
> through socket '/var/tmp/mysql.sock' (111) in
> /usr/local/apache/htdocs/phptest.php on line 24
> 
> Does anyone have an ideas on what is wrong? I've taken a glance
> through the
> apache modules, and nothing appears to be missing. Can anyone help me
> figure
> out what I have overlooked?
> 
> -A.P. Etc
> 
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
> 
> ________________________________________________
> See http://PLUG.phoenix.az.us/navigator-mail.shtml if your mail
> doesn't post to the list quickly and you use Netscape to write mail.
> 
> PLUG-discuss mailing list  -  PLUG-discuss@lists.plug.phoenix.az.us
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss


__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/