PHP Installation
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Installation

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old September 18th, 2006, 11:27 AM
jagguy jagguy is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 jagguy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
php install with mysql

Hi

I have latest stable release of php,apache,mysql but I can't conncect between mysql with php on apache.

I can create a database and tables with command prompt in mysql.

On the php info script test mysql appears.
I try to access a database with php from mysql.

php Code:
Original - php Code
  1.  
  2.  
  3. $dbhost = 'localhost';
  4.  
  5. $conn = mysql_connect($dbhost);
  6.  
  7.  
  8. $dbname = 'petstore';
  9. mysql_select_db($dbname);



The errors I get is

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in Crogram FilesApache GroupApache2htdocsmyone2.php on line 5

Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'ODBC'@'localhost' (using password: NO) in Crogram FilesApache GroupApache2htdocsmyone2.php on line 9

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in Crogram FilesApache GroupApache2htdocsmyone2.php on line 9Is my setup wrong?

Reply With Quote
  #2  
Old September 18th, 2006, 02:25 PM
Kayosz Kayosz is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 25 Kayosz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 2 sec
Reputation Power: 0
RE: php install with mysql

Yup. Setup is wrong. Nah just joking.

I assume that you have a MySQL username and password.

If so, your code should look like this:

php Code:
Original - php Code
  1.  
  2.  
  3. $dbhost = 'localhost';
  4. $user = "root"; //Or whatever
  5. $password = "password"; //Or whatever
  6.  
  7. $conn = mysql_connect($dbhost,$user,$password);
  8.  
  9.  
  10. $dbname = 'petstore';
  11. mysql_select_db($dbname);
  12. ?>
  13.  


As you can see, to connect with php to MySQL you need the host, username and password.

Hope this helps.


Reply With Quote
  #3  
Old September 19th, 2006, 12:20 AM
jagguy jagguy is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 jagguy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: php install with mysql

q) I don't have a username or password setup and I don't want one either. Where do I effect the username/password?

q)When I do the server instance wizard (mysql)the security part fails on me as it claims port 3363 on is not open and to check the firewall, does this effect php ?

Reply With Quote
  #4  
Old September 19th, 2006, 05:51 AM
Kayosz Kayosz is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 25 Kayosz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 2 sec
Reputation Power: 0
RE: php install with mysql

A) A password is not necessary, but you still need a user. Run winmysqladmin.exe to setup user (or server instance wizard).

A) It does not effect php much but MySQL gets whacked since it uses a port. Windows XP SP2 is very picky about security. Click start >> control panel >> Windows firewall. Click the Exceptions tab and click on "Add Port...". Type MySQL as the name and 3363 as the port number. Leave selection at TCP. Click OK. Click OK again. Windows should now not complain about port 3363.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Installation > php install with mysql


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek