You are here: Re: Can't connect MySQL with PHP - Please Help « All PHP « IT news, forums, messages
Re: Can't connect MySQL with PHP - Please Help

Posted by K Kien on 11/04/06 06:51

Gentlemen

I have found out what the problem was.

When I setup MySQL, I had setup a password.
In my 'mysqltest.php' file, I left password blank "". What a silly mistake.

<html>
<head><title>MySQL Connection Test</title></head>
<body>
<h2>

<?php
$connection = mysql_connect("localhost","root","")
or die("Sorry - unable to connect to MySQL");
echo("Congratulations - you connected to MySQL");
?>

</h2>
</body>
</html>

I just typed password there and problem solved.

I thank all of you who participated.


"shimmyshack" <matt.farey@gmail.com> wrote in message
news:1162617869.470644.152330@k70g2000cwa.googlegroups.com...
> try 127.0.0.1 instead, just a thought - shouldnt make any difference.
> if your php was jailed it might as it would now use TCP instead of a
> socket. have you checked whether you can telnet 127.0.0.1 3306 from the
> command line as well?
>
> it might sound strange but if you grab the phpmyadmin zip, and extract
> it somewhere, end edit the config.inc.php with your defaults for mysql,
> all the problems you will encounter will show up as human readable
> (explained) error messages, and things get clickable reducing the
> wastage of time.
> you must make sure though that you take steps to protect the phomyadmin
> directory if you plan to make things public later.
>
>
>
>
> Michael Fesser wrote:
> > .oO(K Kien)
> >
> > >Yes the server gets started automatically by Windows services. I
checked it
> > >again through command prompt to make sure it was running.
> >
> > And what does mysql_error() return?
> >
> > Micha
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация