WordPress.org

Forums

[resolved] Need to create an additional website (21 posts)

  1. bloohair
    Member
    Posted 3 years ago #

    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.

  2. s_ha_dum
    Member
    Posted 3 years ago #

    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.

  3. bloohair
    Member
    Posted 3 years ago #

    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.

  4. bloohair
    Member
    Posted 3 years ago #

    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?

  5. s_ha_dum
    Member
    Posted 3 years ago #

    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?

  6. bloohair
    Member
    Posted 3 years ago #

    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.

  7. s_ha_dum
    Member
    Posted 3 years ago #

    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

  8. bloohair
    Member
    Posted 3 years ago #

    Yep - localhost
    Port 8889
    User - root
    Password - root

    For UNIX:
    Socket - /Applications/MAMP/tmp/mysql/mysql.sock
    if that's any use...

  9. s_ha_dum
    Member
    Posted 3 years ago #

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

  10. bloohair
    Member
    Posted 3 years ago #

    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 ?

  11. bloohair
    Member
    Posted 3 years ago #

    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.

  12. s_ha_dum
    Member
    Posted 3 years ago #

    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"

  13. bloohair
    Member
    Posted 3 years ago #

    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.

  14. skylar180
    Member
    Posted 3 years ago #

    I have the exact same problem

  15. skylar180
    Member
    Posted 3 years ago #

    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.

  16. bloohair
    Member
    Posted 3 years ago #

    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.

    :( :( :(

  17. bloohair
    Member
    Posted 3 years ago #

    I have finally got it to work.
    I did a manual fix to the wp-config.php file and was almost there - when I went to get the log in screen, I got the code for the log in, so realised I couldn't have been far away.

    I think I got tired last night and made a mistake with the username, due to lack of screenshot for one of the stages, always best to leave things to the morning and it has now paid off.

    At least I worked out how to delete a user from the database!!

    Thanks everso much for your help.
    :) :) :)

  18. skylar180
    Member
    Posted 3 years ago #

    glad you solved it bloohair.
    my own resolution came when I used the automatic wp-config thingy. (I forget, if it was install or activate) Since that worked, there was no reason for me not to be able to access the data base. unless I had screwed it up. So then I knew where to look.

    Before that, I had manually configured the wp-config-sample and renamed it too. So I couldn't figure out what was wrong. Once I knew where to look, it was just trial and error.

  19. bloohair
    Member
    Posted 3 years ago #

    Yes, it was the manual input of the wp-config.php file that did the trick.
    To be honest, the start of this problem came from not deleting the config file before setting up the new database, if I'd known that I would probably have got it right first time as I wold have been fresher earlier in the day!!
    LOL

    There's a missing set of instructions somewhere!

  20. bloohair
    Member
    Posted 3 years ago #

    Problem solved, thank you.

  21. s_ha_dum
    Member
    Posted 3 years ago #

    Glad you both got it working.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.