Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Moderated Pro PHP
|
Moderated Pro PHP This is a moderated forum for discussing advanced, professional level issues with PHP. Your posts will not appear until a moderator approves them. Posts that are not the right level for this forum will be responded to and you'll be asked to post them in the [url="http://p2p.wrox.com/sql-server-2000-20/9"]Beginning PHP[/url] forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Moderated Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 22nd, 2005, 05:08 AM
Authorized User
 
Join Date: Aug 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Calverstine Send a message via MSN to Calverstine
Default PHP5 connection problem with MYSQL

(':)') know php 5 has seperated from mysql 4.1 version database server, javascript:insertsmilie
Smile :)anyone know how to configure the PHP 5 to "call" mysql 4.1 to execute the database query?

1.)i've uncomment the php_mysql.dll on php.ini inside apache.
2.) copy "some" dll into the system 32 in the windows installation folder
3.)set the path to reach php c:\php; inside PATH environment.

what else have i miss out?

i've got this error when running the code!
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in G:\Program Files\Apache Group\Apache2\htdocs\a\conn.php on line 4
Could not connect: Can't connect to MySQL server on 'localhost' (10061)

and my coding source is:


<?php

$link = mysql_connect('localhost', 'root@localhost', '@@@')
   or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
?>

 
Old August 26th, 2005, 07:25 AM
Authorized User
 
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to colin.horne
Default

Hello

Please can you check that MySQL is running on localhost, and that it's accepting connections to the correct port.

Thank you

--
Please contact me at:
Colin (dot) Horne (at) gmail (dot) com
My blog: http://colinhorne.blogspot.com
 
Old March 2nd, 2006, 09:36 AM
Registered User
 
Join Date: Mar 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to zimdawg79
Default

I normally connect as follows

<?


INTERNUT
 
Old March 2nd, 2006, 09:39 AM
Registered User
 
Join Date: Mar 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to zimdawg79
Default

I normally connect as follows
<?
     $link = connect("localhost","root","root345") or die(mysql_error());
?>
Remove the root@localhost part and normally the root does not have a password, so if there is no password set just enter

mysql_connect("localhost","root","");

In the above example i assumed that your password was root345

INTERNUT
 
Old December 1st, 2006, 04:06 AM
Authorized User
 
Join Date: Nov 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to talk2leo
Default

hi
zimdawg79 is right

just like this u will connect to databse
mysql_connect("localhost", "username", "password") or die(mysql_error());

it will work just check u r running it on localhost


 
Old December 14th, 2006, 07:03 AM
Authorized User
 
Join Date: Oct 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

for the easiest way to connect all sever connection much better to have either of the two the (XAMPP) and (NETSERVER)

xampp includes evry thing such as:

Apache 2.2.3
MySQL 5.0.27
PHP 5.2.0 & PHP 4.4.4
phpMyAdmin 2.9.1.1
FileZilla FTP Server 0.9.20
OpenSSL 0.9.8d

netsever: just visit this link (http://sourceforge.net/projects/netserver/)

i hope this can help ;))




 
Old December 5th, 2007, 09:22 AM
Registered User
 
Join Date: Dec 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AdnanAhsan
Default

yes, definitely, use user name without domain :) have fun .






Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Connection Problem! Doug86 Dreamweaver (all versions) 3 March 30th, 2008 11:15 AM
mysql & php connection problem. Manu Sharma PHP Databases 2 March 2nd, 2007 07:03 AM
PHP5 connection problem with MYSQL Calverstine PHP Databases 3 August 31st, 2005 01:27 AM
PHP5 connection problem with MYSQL Calverstine PHP How-To 0 August 22nd, 2005 05:09 AM
problem with JSP-MySQL connection pandjie Java Databases 2 November 18th, 2004 04:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.