Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am installing on a local machine using localhost. I have a "learning" version of WordPress @ http://localhost/wordpress and I want to create another version of WordPress (@ http://localhost/jiewmeng) I want to test and maybe move to a real server later. I found that when I extracted a fresh copy of WordPress into localhost/jiewmeng, it probably detects the WordPress database and uses that? All the data I get is from the "learning" version of WordPress.

How do i set this up so that the 2 installations of WordPress are separate?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

The database connection constants are defined in the wp-config.php file. Whether the 2 wp-config.php files in the jiewmeng directory and the WordPress directory are the same?

You need to create 2 different databases and set their constants in the respective wp-config.php files.

share|improve this answer
    
i actually just extracted a fresh wordpress for the localhost/jiewmeng version. it didnt even have a wp-config.php i tried to add 1 and change the database name, it still connects to the old localhost/wordpress install. i even tried renaming the database from wordpress to wordpress_old and try again, both installs fail as they tried to connect to the same database. the workaround i had was create a new vhost http://jiewmeng to host my 2nd wordpress and it works. curious to know why this happens tho –  Jiew Meng Sep 12 '10 at 3:10
1  
I'd be curious to know what kind of a setup you're running on your local machine. What you're running into is a server configuration/administration issue ... not a WordPress issue. You can have two separate WordPress installations on the same server connect to different databases because you explicitly identify the database when you set up WordPress. If they're both pointing to the same DB, it's because either you told them to, or your server did ... WP doesn't do that on its own. –  EAMann Sep 12 '10 at 4:33
    
i didnt tell them to look at the same database so maybe the server did? i am running windows 7, apache, php 5.3.2, mysql, wordpress 3.0.1 ... what other info needed? btw, creating a new vhost doesn't help actually, now my old wordpress http://localhost/wordpress uses the data from my new wordpress http://jiewmeng ... also, i noticed that when i goto localhost/wordpress now, its using the data from jiewmeng and all links goes to jiewmeng... –  Jiew Meng Sep 12 '10 at 6:48
    
somehow it works now ... i dunno whats wrong with it lol ... maybe some browser cache or something ... if anyone happens to have the same issue or know whats wrong let me know –  Jiew Meng Sep 12 '10 at 7:46
    
@jiewmeng strange indeed. :) –  Box Sep 13 '10 at 0:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.