WordPress.org

Forums

Instaling two wordpress ?! (11 posts)

  1. Bucki
    Member
    Posted 2 years ago #

    Hi

    I already got one wordpress installed in domain.com/subdomain1
    and in the function.php - I changed the database name to "wp1"

    Now, could I do ahead and do similar thing to /subdomain2
    and change it to "wp2" ?!

    Will this make sure that two different database tables are being used?
    In other words: will this cause any issue with my other installed WP ?

    Cheers

  2. Bucki
    Member
    Posted 2 years ago #

    "... and in the function.php - I changed the database name to "wp1"
    of course this was done prior (before) I run the installation etc

    Just for clarification :D

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    Running 2 WP installs is fine when they are in separate domains/subdomains/folders

    So your setup will be good. There should be no conflict file structure / URL wise

    As for the database, you have 2 options. You can have an individual database for each install, but it sounds like you want to use 1 database

    That also works well, you just need to use a different prefix in the database for the second install, as you have suggested -- You should be able to setup that prefix during installation, I believe WP asks for a DB prefix during the install phase

  4. Bucki
    Member
    Posted 2 years ago #

    Hi

    Thanks!

    Yeh, could I not create a different database table
    and specify it so in the function.php?

    Reason for that is so it wont mess up my other wp database table :)

  5. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    functions.php in your theme?

    I think the issue is, if you are to the point of editing your theme files, WP is already installed - would that not be true? So the tables are already set up.

    If you handle the prefix at installation time, it's done from the start.

    I personally have about 10 WP sites running on my server, and I prefer to have 1 DB per install. It just keeps everything individual. That's just my preference

  6. Bucki
    Member
    Posted 2 years ago #

    Yeh, thats what I am saying = 1 DB per install.
    in my cPanel there is the MySQL option, where you can go ahead and create many DB TABLES.

    Cannot recall the WP installation process asking you if wanting to create a new table etc?!

  7. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    Ah... OK. You want the individual tables. That's the way I prefer.

    So yeah. You actually tell WP what table to use in the wp-config.php file for each install.

    So you already have 1 installation in one table.

    You now make your new table through phpmyadmin, or whatever cpanel tool you have available to you.

    You can then input the new details on installation, or manually edit wp-config.php of the new install.

    http://codex.wordpress.org/Installing_WordPress#Step_2:_Create_the_Database_and_a_User
    Info here may help

    The info that you enter into wp-config.php (or enter into the setup screen) will point WP to use the new database

  8. Edit: The Right Reverend Voodoo replied faster than I did. ;)

    in my cPanel there is the MySQL option, where you can go ahead and create many DB TABLES.

    You can use one DB and just have a different $table_prefix for the different installations via your wp-config.php file.

    /**
     * WordPress Database Table prefix.
     *
     * You can have multiple installations in one database if you give each a unique
     * prefix. Only numbers, letters, and underscores please!
     */
    $table_prefix  = 'wp_';

    They'll need to be in different independent directories but that does work.

    I'm avoiding the mention of Multisite at the moment. ;)

  9. Bucki
    Member
    Posted 2 years ago #

    Jan

    Yeh both WP will be on different directories anyway.
    And yes, I was going to use a different table_prefix

    But was not clear about the DB Table.
    In simple terms, both WP using ONE DB TABLE but with different prefix?!

    I just thought, if anything happens then it will mess up the database of my first wp (where I have over 200 pots lol)

  10. The different table prefixes means different tables.

    If the two installs have different table prefixes (they should) they you will not be sharing the same tables. Just the same database.

  11. Bucki
    Member
    Posted 2 years ago #

    Great :)

    That rests my mind now :D

    Cheers all

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.