Re: mysql_connect error



"avenpace@xxxxxxxxx" wrote:

I got error when using mysql_connect function in my php script.
If i set the db host to localhost, it give me that error altough all
the user and password that I wrote is true(I can login using that
username/passwd using mysql console), but when I change the db host
into 127.0.0.1 mysql_connect will work.
What were you using before?
before I use mysql_connect("localhost","root","password") this not
working but when I use mysql_connect("127.0.0.1","root","password")
will work

Have you checked if 'localhost' resolves?

Bye!
.



Relevant Pages

  • Re: Unable to resolve hostname (winsock problem?)
    ... "Charlie Tame" wrote: ... >> The only thing in my hosts file is localhost. ... >>> # be placed in the first column followed by the corresponding host name. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: #host localhost
    ... $ host localhost ... with a cost -- the cost of learning about DNS and configuring your ...
    (comp.unix.bsd.freebsd.misc)
  • Re: DBIx::DBH - Perl extension for simplifying database connections
    ... host that it would not connect using the host name and end up using TCP on ... The server name is ... important because I use the localhost name to match up with that, ... matches then don't add in the hostname to the connect string. ...
    (perl.dbi.users)
  • Re: Rerouting IP requests internally
    ... certain external database server, now wants to host the database locally, so ... we want to route any requests to the old db server to localhost basically. ... We have no control over the external host / IP so routing is the only way,, ... the ideal situation here is to fix the app such that the ...
    (microsoft.public.windows.server.general)
  • Re: Can not ping localhost -- all looks correct...
    ... > ping: unknown host localhost ... command line but I am getting a similar error which says "Local Host ...
    (comp.os.linux.networking)