Support » Localhost Installs » WP on XAMPP USB – can't connect to database?

  • I am installing a WP instance to use as a sandbox on XAMPP Lite on a USB stick. I know the database works (and is running) because I use it for other ‘sites’ on the stick. (Plus the WP install function does manage to create tables in the wordpress db I created).

    I cannot get the WP install to be successful, I have removed/reinstalled several times and followed every instruction I could find online to see if any changes helped. Essentially they all give the exact same instructions, except advice on whether or not set up a wordpress db user/password vs. using root.

    On Install, I never get the Success!! screen – just a WordPress Logo and the url has ‘step=2’ appended. When I try going back to install.php, I get ‘One or more database tables are unavailable. The database may need to be repaired.’

    I click on repair, and it brings me to a ‘are you sure you want to do this’ screen. I click ‘Try again’ then it brings me back to the ‘One or more database tables are unavailable. The database may need to be repaired.’ screen.

    When I go to wp-login.php I get ‘Error establishing a database connection’. Which makes no sense because it obviously connected with it at one point because all the tables got created. Please help.

    I’m probably missing something so simple it’s invisible to me.


Viewing 11 replies - 1 through 11 (of 11 total)
  • Update: still no luck, however 2 things popped out at me during research:
    1. there is no ?> closing out the wp-config file (I added it). I removed all line breaks, too. Dropped DB, reinstalled, no change.
    2. table wp_options doesn’t exist in wordpress db – should this have been generated on the install? Found reference to this table in another forum post where accessing the db was a problem – although not installed on local xampp

    These are the only tables that exist in the db:

    Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    You don’t nee the closing ?> for what it’s worth.

    And it LOOKS like WP is able to write to the DB so that’s good (otherwise you wouldn’t have the tables you do have).

    What version of PHP and SQL are you running?

    Thank you for your response.

    From phpinfo:
    mysqlnd 5.0.8-dev – 20102224 – $Revision: 310735 $
    PHP Version 5.3.8

    Note that I finally got a list of missing tables after changing $cfg[‘ExecTimeLimit’] = 0; in xampp\phpMyAdmin\libraries\config.default.php – this gave it unlimited time to execute the repair as it had appeared to be running very slow.

    Missing tables:
    wp_users: Table ‘wordpress.wp_users’ doesn’t exist
    wp_usermeta: Table ‘wordpress.wp_usermeta’ doesn’t exist
    wp_posts: Table ‘wordpress.wp_posts’ doesn’t exist
    wp_links: Table ‘wordpress.wp_links’ doesn’t exist
    wp_options: Table ‘wordpress.wp_options’ doesn’t exist
    wp_postmeta: Table ‘wordpress.wp_postmeta’ doesn’t exist

    I re-downloaded the WP zip thinking perhaps something had been corrupted in the download. Ran the checksum on it and it was fine. Re-installed, etc. and no change.

    Note that there is over 1.5 G left on thumb drive so it’s not a problem with capacity. I will try to install it to a WAMP system I have on another computer and see if I end up with the same issue.

    Unfortunately, the point of putting it on the USB is that I use different systems between work and home and I really need it to be portable.

    Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Okay, since you have nothing on this one, wipe the DB and reinstall THAT again (if the DB is empty, WP will just try to reinstall).

    @Ipenstu: I have done that at least 10 times with no change, only installs the same 5 tables.

    @samuel B: Yes, I did what was indicated on that page. The instructions were the same as many other pages I reviewed to try to track down the issue.

    Note that Apache, PHP, and MySQL work fine on the stick – have been using them for other sites as this is my testing environment.

    I have installed WP on WAMP on my old XP machine and the install went without a hitch…
    Perhaps I should just export the db and import into the xampp version?

    I exported the db from the WAMP version on XP then imported to xampp and it seems to be working. I think the issue must be that the connection to the USB is slow and creating the tables gets timed out. May be time for a new USB stick, but would really like to figure out if this is really the problem and how to fix it.

    I just did another install on usb stick to test
    works well
    you may be correct about the table creation

    Yeah – something is timing out – I tried to install a plugin that was pretty large and it timed out, while a smaller plugin installed easily. I just downloaded the zip of the larger one and extracted under plugins, then activated it. It worked fine.

    Not sure where the timeout occurs – I’ve looked at a few different files but nothing is really clear as to which timeout out applies where & when. Probably put in place as a security feature and is set just fine for a normal server.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘WP on XAMPP USB – can't connect to database?’ is closed to new replies.