• Resolved leejosepho

    (@leejosepho)


    This is actually a question abut XAMPP rather than about WordPress, and I ask here because I have not found a clear answer anywhere else. Here is what I have in my multi-boot machine:

    #
    # _localhostW7 b4_loco0 database for
    # http://localhost/b4_loco0/wp-admin/index.php
    #datadir = "X:/xampW7/mysql/data"
    #
    # _localhostXP b4_loco0 database for
    # http://localhost/b4_loco0/wp-admin/index.php
    datadir = "X:/xampXP/mysql/data"
    #

    My XAMPP for WinXP is older than my XAMPP for Win7, and the above in ‘my.ini’ did not work in Win7. Simple logic suggests to me that either XAMPP installation should be able to access either database.

    Question: Should I keep trying or is that not even possible?

    Many thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • It is possible for multiple WordPress installations to share a database PROVIDED that they have distinct TABLE_PREFIX settings. This is the WordPress answer.

    I suspect that your question is about a machine which can boot either winXP or win7 and you really want the same WordPress to be present in both cases, if this is the real question then I suggest that you follow it up in the Windows and XAMPP context.

    Thread Starter leejosepho

    (@leejosepho)

    I suspect that your question is about a machine which can boot either winXP or win7 and you really want the same WordPress to be present in both cases

    Yes, that is what I have asked, and it would not even matter whether the database were for WordPress. I am wanting to know whether a single, common database can be accessed by separate installations of XAMPP (regardless of version and only one-at-at-time).

    I am wanting to know whether a single, common database can be accessed by separate installations of XAMPP (regardless of version and only one-at-at-time).

    I think the answer is yes.
    Of course you will want the mySQL versions to be identical or with compatible configurations.

    Keep backups. See how it goes.

    Thread Starter leejosepho

    (@leejosepho)

    Of course you will want the mySQL versions to be identical or with compatible configurations.

    You might be correct there if it matters that the MySQL being used is running inside XAMPP, but I think databases can be moved from one host or server to another having different versions of MySQL without that being an issue, can they not? (Just guessing here.) However…

    For my first attempt, I had already installed both XAMPPs (XP & Win7), then discovered this following was not enough for the Win7 XAMPP (MySQL) to be able to do a new WordPress installation while being sent to an existing database first made in XP:

    #
    # _localhostW7 b4_loco0 database for
    # http://localhost/b4_loco0/wp-admin/index.php
    #datadir = "X:/xampW7/mysql/data"
    #
    # _localhostXP b4_loco0 database for
    # http://localhost/b4_loco0/wp-admin/index.php
    datadir = "X:/xampXP/mysql/data"
    #

    WordPress in Win7 (surprisingly) began with the language selection prompt, then showed “users already exist” at the next prompt and only wanted a password…but then could not find that user and I next saw a page-full of database errors saying no tables existed or something like that. So, apparently more than the above code is needed in XAMPP to use a database located somewhere other than where it would normally expect to be sent.

    Working on the theory that whatever that might be might no longer be an issue now that I have completed the Win7 WordPress installation with its own database, I will again try the above code to see whether the Win7 XAMPP can recognize *all* of the XP database.

    Thread Starter leejosepho

    (@leejosepho)

    My XP_XAMPP can export a database my Win7_XAMPP can import and run, but these two lines are not enough to allow either to access the database of the other:

    #datadir = "X:/xampW7/mysql/data"
    datadir = "X:/xampXP/mysql/data"

    So, maybe more of this or something else altogether would also have to be changed:

    # The MySQL server
    [mysqld]
    port= 3306
    socket = "X:/xampXP/mysql/mysql.sock"
    basedir = "X:/xampXP/mysql"
    tmpdir = "X:/xampXP/tmp"
    #
    #datadir = "X:/xampW7/mysql/data"
    datadir = "X:/xampXP/mysql/data"
    #

    Somewhere I read something about starting MySQL with code in php.ini rather than from the XAMPP Control Panel, and maybe that would make it easier to modify the database path. But since I can at least export/import, I might not bother trying anything more here.

    Thread Starter leejosepho

    (@leejosepho)

    Got it!

    Here are my two versions of XAMPP:
    xampXP-win32-1.8.2-0-VC9-installer.exe
    xampW7-win32-5.6.3-0-VC11-installer.exe

    The MySQL in the XP version cannot access the database made by the Win7 version, but the MySQL in the Win7 version does just fine with the database first made by the XP version. And, the only issue with any of that is this from the mysql_error.log:

    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    150219 14:57:29  InnoDB: Database was not shut down normally!
    InnoDB: Starting crash recovery.
    InnoDB: Reading tablespace information from the .ibd files...
    InnoDB: Restoring possible half-written data pages from the doublewrite
    InnoDB: buffer...
    150219 14:57:30  InnoDB: Waiting for the background threads to start
    150219 14:57:31 InnoDB: 5.5.32 started; log sequence number 22709476

    Nothing there affects the WordPress database, but I will still try to find a way to to correct that.

    So after also changing my ‘DocumentRoot’ and ‘Directory’, I can now use just one installation of WordPress and one database (containing several sets of tables) to work on any site from either OS and even from any other machine here in my local network.

    #####
    # 'X:/xampXP/mysql' -replacing- 'X:/xampW7/mysql' data paths
    ########################
    ### my.ini
    #datadir= "X:/xampW7/mysql/data"
    datadir= "X:/xampXP/mysql/data"
    #innodb_data_home_dir= "X:/xampW7/mysql/data"
    innodb_data_home_dir= "X:/xampXP/mysql/data"
    #innodb_log_group_home_dir= "X:/xampW7/mysql/data"
    innodb_log_group_home_dir= "X:/xampXP/mysql/data"
    #innodb_log_arch_dir = "X:/xampW7/mysql/data" (obsolete)
    #innodb_log_arch_dir = "X:/xampXP/mysql/data"
    ########################
    ### httpd.conf
    #DocumentRoot "X:/xampW7/htdocs"
    DocumentRoot "X:/xampXP/htdocs"
    #<Directory "X:/xampW7/htdocs">
    <Directory "X:/xampXP/htdocs">
    ########################
    ### httpd-ssl.conf
    #DocumentRoot "X:/xampW7/htdocs"
    DocumentRoot "X:/xampXP/htdocs"
    ########################
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can two installations of XAMPP share one database?’ is closed to new replies.