WordPress.org

Support

Support » Localhost Installs » [Resolved] Need to create an additional website

[Resolved] Need to create an additional website

  • I am new to WordPress, but have been creating websites for many years with Dreamweaver, I think that now is the time to add WP to my skills. However, I am finding doing simple things like creating a new website confusing.
    I have installed WordPress and MAMP successfully, uploaded to remote hosting co and everything is fine.
    I now need to create a site for a real client on my Localhost.
    I need a new website that is different from the first one, it will probably use a different theme etc.
    I have followed these instructions:
    – Download and install WordPress again and place the second site in htdocs.
    – Set up another database in MAMP, added new user and granted all permissions
    – Attempt to install the new WP with new Database Name, User name and password
    – WP gives me error message that the Database does not exist

    So I manually input the DB name, Username and PW into a wp-config.php file. Still not luck.

    Can someone tell me the correct procedure for creating additional websites that don’t interfere with each other.

    Completely lost.

Viewing 15 replies - 1 through 15 (of 20 total)
  • It should be relatively simple.

    1) You need to keep your WordPress installs in seperate directories, For example:
    — htdocs
    —- WP1
    —— wp-config
    —— wp-includes
    —— etc
    —- WP2
    —— wp-config
    —— wp-includes
    —— etc
    2) Use different database names. On a local install you can reuse the username and password.

    You can’t copy .htaccess files from directory to directory though. Those need to be different is a couple of details. WordPress will create them.

    Without more details that is about all I’ve got.

    Hi s_h_dum
    Thanks for your reply, I’ll try and explain things better.
    I understand what you are saying about separate directories – this I have already done – I have the original WP install, plus a second one just like you outline above. I understand completely that I need different database names, passwords, config files etc. for the new ‘site’.

    I have told MySQL to create a new database, then to “Add a new User”, fill in all the required fields, make sure “Grant all privileges” is selected and click “GO”, and finally reload the privileges.

    Then I tried to connect the database to the new WP2 but I got the Error message that the database did not exist. I noticed that the wp-config.php file had not been generated. So I did it manually. Still not working.

    Is there something I have missed?

    I appreciate your help with this matter.

    I mean when I type: http://localhost/WP2 in my browser I get:
    Error establishing a database connection
    I don’t get ‘Create a Configuration File’.

    I did get ‘Create a Configuration File’ when I did it the first time today, went through the set up, clicked “submit” but this gave me an error message.

    But it has got worse, the more I try.

    Should I uninstall WP2 and start again?

    Should I uninstall WP2 and start again?

    No. Deal with the first issue first. What kind of tools do you have to manage the database? Can you verify that the new database was in fact created and the the name is correct?

    Sorry to be so long getting back, your last notification went into Junk!
    I have MAMP 2.0
    WP 3.3.2
    Intel Mac Pro running OSX.6.8
    Dreamweaver CS5.5
    Text Wrangler

    Yes, my DB name, user name, password etc all spot on.

    What is your DB_HOST walue? Should be “localhost” or “127.0.0.1” but there may need to be a “port” value too– something like “localhost:1234”. Look around in MAMP’s configuration and see if you can find what port MySQL is on.

    http://codex.wordpress.org/Editing_wp-config.php#MySQL_Alternate_Port

    Yep – localhost
    Port 8889
    User – root
    Password – root

    For UNIX:
    Socket – /Applications/MAMP/tmp/mysql/mysql.sock
    if that’s any use…

    Then your DB_HOST value should be “localhost:8889”. Is that right?

    Yes, that would be right.
    WP1 was set up on http://localhost/wordpress/ which was all fine.

    So should I try http://localhost:8889/WP2 ?

    I tried http://localhost:8889/WP2 but this did not work either.

    So I tried it all again from a fresh start.
    Created a Database for WP2 in phpMyAdmin, all fine.
    This time as with the first time I was able to ‘Create Configuration File’, filled in the required fields: DB name, username, password.
    Database host = localhost
    Table prefix = wp_

    Clicked “Submit”
    Got this error:
    Error establishing a database connection

    *This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.

    Are you sure you have the correct username and password? YES
    Are you sure that you have typed the correct hostname? YES
    Are you sure that the database server is running? YES
    If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums. DOING

    *There is no wp-config.php file, just the sample one – I understand from my original install (WP1) that the wp-config.php file is generated when you click ‘submit’ for the installation. The config file then carries your WP set up details which I have looked at for WP1 and understand how to change them. But if I save the sample config file and manually input these details, it still does not work.

    I tried http://localhost:8889/WP2 but this did not work either.

    Right. That wouldn’t work. Your web server, Apache, and your database, MySQL, have to be on different ports and MySQl is on 8889. Trying to connect to the database as if it were a web server isn’t going to work.

    This time as with the first time I was able to ‘Create Configuration File’, filled in the required fields: DB name, username, password.
    Database host = localhost

    Database host (DB_HOST) needs to be “localhost:8889”

    Still no joy.

    I must be doing something fundamentally wrong when I set up the Database and user.
    I have removed the attempted databases, but now have several ‘users’ in MAMP that I’d feel happier removing as these will confuse me in the long run.

    It’s probably best if I start again in the morning as it is getting late now in the UK.

    Thanks for your help.
    I will continue tomorrow, hopefully I’ll find where I’m going wrong.

    skylar180
    Member

    @skylar180

    I have the exact same problem

    skylar180
    Member

    @skylar180

    I solved it bloohair!!
    Go to your database.
    I use PhpMyAdmin.
    select the database then choose the tab that says “privileges”
    click on “Edit Privileges” for the user name you chose in your wp-config.php file
    Scroll to nearly the bottom and where it says LOGIN INFORMATION,
    you will see an option for HOST. That’s what we forgot to change!
    choose local and scroll down to save.

    When you check it again, to see if it was saved, it looks like it isn’t. It appears to revert back to %. But the process should work now.

    Hi Skylar and s_ha_dum
    It’s still not going right.
    I did what you said Skylar and checked the Login Information, my HOST said Localhost anyway, no ‘%’ sign. So it seems that wasn’t the problem.
    I tried Localhost:8889 too but that didn’t work either.
    The WP install procedure says that you can manually set up the wp-config.php file, so I’ve attempted this again today, if I click ‘submit I get an error to say that the file already exists. So I then try to log into the site like this: http://localhost/CSNI/wp-login.php and get another error message: Error establishing a database connection.

    🙁 🙁 🙁

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘[Resolved] Need to create an additional website’ is closed to new replies.