|
Posted by Frances on 06/06/06 21:41
disregard -- now all of a sudden can't connect from Java either.. I
don't get this.. I've been connecting successfully to db for over a
year from both Tomcat & java stand-alone classes, now all of a sudden am
trying to connect also from PHP and I can't connect at all..
when try to connect just from console get error:
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
what is this.. what is 10061.. :(
is it really not possible then to connect to one MySQL server from diff
web servers? (I don't think so..) I want to set up my machine so can
connect to same MySQL server from Tomcat, IIS, PHP.. (the port thing is
also a big pain and don't know if will be able to pull this off..) thank
you very much..
Frances
Frances wrote:
> this seems pretty straight-forward.. got this code
>
> $link = mysql_connect('localhost:3306', '<uid>', '<pswd>');
> if (!$link) {
> die('Could not connect: ' . mysql_error());
> }
> echo 'Connected successfully';
> mysql_close($link);
>
> from here..
> http://us2.php.net/function.mysql-connect
>
> but can't connect, get this error:
>
> Connect to db:
> Warning: mysql_connect() [function.mysql-connect]: Can't connect to
> MySQL server on 'localhost' (10061) in
> C:\xampp\xampp\htdocs\home\conn.php on line 19
> Could not connect: Can't connect to MySQL server on 'localhost' (10061)
>
> I connect to this same MySQL server from Tomcat w/no problem.. what is
> issue here pls...
>
>
> now on top of pg mentioned above, there this description:
>
> resource mysql_connect ( [string server [, string username [, string
> password [, bool new_link [, int client_flags]]]]] )
>
> what does 'resource' refer to here pls... and where to do specify what
> db to connect to... (in java you put db-name in same line where you
> make the connection..)
> (and don't you need a driver to connect, I use a JDBC driver to
> connect w/Java..)
>
> would very much appreciate some help.. thank you...
>
> Frances
>
Navigation:
[Reply to this message]
|