Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connectivity with MySQL windows 2k

Status
Not open for further replies.

ScottCybak

Programmer
Sep 29, 2000
48
CA
Here's the scoop.

I mangaged to get PHP working in windows 2000. I managed to get MySQL installed on the box, and now, i'm trying to use php to connect to a MySQL database locally.

i can't get the:

$link = mysql_connect ("C:/mysql/bin/mysqld-nt.exe", "myusername", "mypassword");

to work.

i tried, just c:/mysql, and c:/mysql/bin, to no avail..

what am i doing wrong?

TIA Scott Cybak
scott@athree.com
 
Ok, the reason that is not working is you are not putting the name of the host as the first argument in the mysql_connect() function. The first argument is the server, not the location of the mysql exe.

So change
[tt]
$link = mysql_connect ("C:/mysql/bin/mysqld-nt.exe", "myusername", "mypassword");
[/tt]

to this
[tt]
$link = mysql_connect ("localhost", "myusername", "mypassword");
[/tt]

Hope this helps.

-Vic vic cherubini
krs-one@cnunited.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash
====
 
also, remember to have mysql running as a service since you are on win2000 (c:\mysql\bin\winmysqladmin.exe)

Just run this app and go through the initial setup process (about 30 seconds to generate the my.ini file).

Chad. ICQ: 54380631
 
Thanks for the 'localhost' tip, worked like a charm.. i now have the ability to use mysql to generate more errors on top of PHP's

:D

Thanks fellas Scott Cybak
scott@athree.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top