|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here! |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi guys, I just signed up with a new server and I'm having trouble connecting to the database.
My current server is a windows based server and my new server is Linux. I want to fully test the database on the new server before I change the DNS. Here is the config.php file that I use for a few pages: CONFIG.PHP <?php $xxxConfig_dbhost = 'mysql.mywebsite.com'; $xxxConfig_dbusername = 'sql@mywebsite.com'; $xxxConfig_dbpasswd = 'password'; $xxxConfig_database_name = 'database'; ?> And here is the db.php file: DB.PHP <? /* Database Information - Required!! */ /* -- Configure the Variables Below --*/ require_once("config.php"); /* Database Stuff, do not modify below this line */ $connection = mysql_pconnect("$xxxConfig_dbhost","$xxxConfig_dbu sername","$xxxConfig_dbpasswd") or die ("Couldn't connect to server."); $db = mysql_select_db("$xxxConfig_database_name", $connection) or die("Couldn't select database."); ?> Of course I changed the real values but the syntax is the same. Now the new server that I'm trying to connect to is a Fedora Linux server. I tried to use the same code above to connect to the server using just the IP address because I want to fully test the site before I change the DNS. Here it is CONFIG.PHP (NEW) <?php $xxxConfig_dbhost = 'mysql.00.11.22.333'; $xxxConfig_dbusername = 'sql'; $xxxConfig_dbpasswd = 'password'; $xxxConfig_database_name = 'database'; ?> The only real difference here besides changing the IP address is that the new username doesn't have the @mywebsite.com after it. I assume this is a limitation of Linux. Am I doing this correctly? I feel like I've tried everything. Is it possible to connect to a database by IP only? I appreciate any help thanks |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |