Localhost to Public – Do I need two separate databases?
-
Hello there,
I am new at WordPress and generally everything to do with web and setting up local servers/ databases etc, so apologies if I’m unclear or don’t understand your advice fully, I’m still learning 🙂
I have set up my localhost and mySQL through XAMPP, and got WordPress running locally. After setting up my domain and hosting (cPanel) I used Filezilla to transfer my local blog files to my host, and for a while I couldn’t get my local wordpress to show there; it only showed a default unreleated wordpress (my posts werent there, it was just the standard “Hello World”). After I checked my username and password both in cPanel and wp-config.php, I finally established a connection and could see my local blog with my own header image! ( However the credentials that finally worked were not those of the user assigned to the database in phpMyAdmin, these credentials were no where to be seen on phpMyAdmin. But they worked, apparently. Does that sound right to you? )
The main trouble I’m having now is editing posts that will be shown at the public address location, and not just locally. Do I need two separate databases in phpMyAdmin, and import/export any new posts between them?
The wp_admin was redirecting me to localhost/wp-admin, even when entered as http://www.example.net/wp-admin, meaning that changes I made were not being seen my public blog adress, but only at the localhost version of the blog.
I tried changing the WordPress Address and Site Address in the dashboard to be my public URL and was logged out automatically, but then none of my username/password combinations worked – I was locked out, and the localhost location no longer worked. Having no way to get back into my admin area, I changed the WP_HOME, and WP_SITEURL both back to localhost inside the wp_config.php file, which allowed me to at least log back in again.
I went back to settings, and changed the URLs again. At the moment the WordPress Address is my public address (http://example.net) and the Site Address is http://localhost:
define(‘WP_HOME’,’http://localhost/’);
define(‘WP_SITEURL’,’http://example.net’);I can see my new posts now! But only on the front page, the permalinks are still stuck as localhost, so trying to access individual posts remotely is denied.
Sorry if my exact problem isn’t clear, I guess I’m not sure how to describe it. Basically, do you need to be able to access two separate wp-admin areas, one local and one public? To do this, would you then need two separate databases? Or is it usual to have only one admin area, and should that be local or public?
Thank you in advance for any help!
The topic ‘Localhost to Public – Do I need two separate databases?’ is closed to new replies.