If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Can connect to hosted mySQL, having trouble with local

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-21-09, 13:45
JohnLuker JohnLuker is offline
Registered User
 
Join Date: Oct 2009
Posts: 5
*Resolved* Can connect to hosted mySQL, having trouble with local

We have a web application that we had developed that connects to a mySQL db through .php pages. We have the application hosted at Network Solutions. Works fine.

I'm building a local machine to use for offline demos. I've downloaded the database from Network Solutions and put the .php files in the correct directory to use.

CentOS 5.3
apache
php
mysql

Http://127.0.0.1/secure/index.php takes me to the application's login page, but it doesn't connect to the db.

phpMyAdmin:

Server: localhost Database: database1


Users having access to "database1"
User Host Type Privileges Grant Action
webuser localhost global ALL PRIVILEGES Yes
root localhost global ALL PRIVILEGES Yes



The two pages that deal with connecting to the db I edited: class.login.php and class.dbcon.php to:

private static $dsn = "mysql:host=localhost;dbname=database1";
private static $usr = "webuser";
private static $psw = "xxxxxxxxxxx";

The password "xxxxxxxxxxx" is the password that I set in phpMyAdmin for the user 3cpo.

What am I missing? Thanks in advance, J.

Last edited by JohnLuker; 10-21-09 at 18:01. Reason: resolved
Reply With Quote
  #2 (permalink)  
Old 10-21-09, 14:55
JohnLuker JohnLuker is offline
Registered User
 
Join Date: Oct 2009
Posts: 5
I was able to successfully log in to phpMyAdmin using the username/pwd combination from the two files, if that helps.
Reply With Quote
  #3 (permalink)  
Old 10-21-09, 16:27
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
If it's a web app why do you need a local machine to do demo's? Surely you just go the web page as before as a guest user. Also the address 127.0.0.1 is a special type of URL that goes back to your own machine so giving it to us will do nothing (see this page).
Reply With Quote
  #4 (permalink)  
Old 10-21-09, 17:20
JohnLuker JohnLuker is offline
Registered User
 
Join Date: Oct 2009
Posts: 5
Quote:
Originally Posted by mike_bike_kite
If it's a web app why do you need a local machine to do demo's? Surely you just go the web page as before as a guest user. Also the address 127.0.0.1 is a special type of URL that goes back to your own machine so giving it to us will do nothing (see this page).

You must have missed the "offline demo" part. There is a specific reason for this that is not really relevant to the discussion.

Thanks for the link.
Reply With Quote
  #5 (permalink)  
Old 10-21-09, 17:26
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,258
has the db been restarted or privileges flushed since they changes been made

in the absence of error messages its hard to diagnose the fault
there may be some more info in the web server logfile
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #6 (permalink)  
Old 10-21-09, 19:53
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
Quote:
Originally Posted by JohnLuker
You must have missed the "offline demo" part. There is a specific reason for this that is not really relevant to the discussion.
I didn't miss it, I just didn't understand why you were doing it that way. A few advantages of using the same live web application for the demo might be:
  • no need to install your application plus MySQL, PHP, Apache etc onto separate hardware
  • easy to demo to the user in the environment they're going to use it - ie on their browser
  • the user sees the real application and not whatever version of the software you last downloaded onto your PC
  • the performance of all the demo will mimic that of the live system
  • generally fewer issues to contend with and so save time
  • you don't have to be physically at every demo
  • no chance of loosing your hardware and all the precious code with it
  • no need to drag any hardware around with you
Obviously I know nothing of your application but I'm just curious what benefits you were expecting from going against this more traditional approach? Going against this approach also caused you the problems you're having so it is kind of relevant to the discussion.

Mike
Reply With Quote
  #7 (permalink)  
Old 10-21-09, 20:03
JohnLuker JohnLuker is offline
Registered User
 
Join Date: Oct 2009
Posts: 5
Quote:
Originally Posted by mike_bike_kite
I didn't miss it, I just didn't understand why you were doing it that way. A few advantages of using the same live web application for the demo might be:
  • no need to install your application plus MySQL, PHP, Apache etc onto separate hardware
  • easy to demo to the user in the environment they're going to use it - ie on their browser
  • the user sees the real application and not whatever version of the software you last downloaded onto your PC
  • the performance of all the demo will mimic that of the live system
  • generally fewer issues to contend with and so save time
  • you don't have to be physically at every demo
  • no chance of loosing your hardware and all the precious code with it
  • no need to drag any hardware around with you
Obviously I know nothing of your application but I'm just curious what benefits you were expecting from going against this more traditional approach? Going against this approach also caused you the problems you're having so it is kind of relevant to the discussion.

Mike
Actually going against the "traditional" approach helped me learn something, so there is great value there. Why we're doing what we're doing really is completely and totally irrelevant to the discussion.

But since you're so interested: We're doing the demo offline because the production system will be installed on an intranet. The system contains sensitive information that cannot be transmitted across the public internet.
Reply With Quote
  #8 (permalink)  
Old 10-21-09, 20:08
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
That's all I needed to know, good luck learning how to fix your problem
Reply With Quote
  #9 (permalink)  
Old 10-21-09, 20:10
JohnLuker JohnLuker is offline
Registered User
 
Join Date: Oct 2009
Posts: 5
Quote:
Originally Posted by mike_bike_kite
That's all I needed to know, good luck learning how to fix your problem
Thanks. Got it working earlier, hence the "*resolved" edit.

Thanks for your help.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On