1 Reply Latest reply on Feb 19, 2010 9:34 AM by M.R.Biesheuvel

    Dynamic Website


      I created a virtual host locally with a mySQL database. For testing, I point to the mySQL database on my PC. The problem is the local database does not have a password...and my database on the server does.


      Question is...


      Is there anyway to have my testing server pointing to my local database (without the password) and the live server pointing to the live database? I find I have to change the database setup to include the password before uploading my site.

        • 1. Re: Dynamic Website
          M.R.Biesheuvel Level 3

          Well the only thing I suggest that you build a script witch first trys to connect to the local database and if that fails trys to connect to the database on the server. So if your site is uploaded your site will eventually only connect to the database on the server. That way you don't have to alter your your connection each time you ulpoad it. On the other hand, its a cost to the performance and I wouldn't do that cause each time you make a roundtrip to the database it has to go through al the scipt and timeouts.


          I use MySql with asp.net and what I do is just enter the servername login name and the password in a config file so each time I upload a site I only have to change the config.


          The best thing you can do is make a seperate config just for your server and upload that file insted of your testing config on the local machine...safest way and allways works

          1 person found this helpful