Unable to connect to DB [Answered]

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Unable to connect to DB [Answered]

Postby tryin_to_learn » 30. July 2012 17:58

I installed the latest version of XAMPP and am now unable to access my DB from my localhost. The DB shows in PHPMyAdmin just fine. The mysql error log has a whole bunch of errors all similar to this:

120730 12:02:02 [ERROR] Cannot find or open table shrink_office/submissionhistory from
the internal data dictionary of InnoDB though the .frm file for the
table exists. Maybe you have deleted and recreated InnoDB data
files but have forgotten to delete the corresponding .frm files
of InnoDB tables, or you have moved .frm files to another database?
or, the table contains indexes that this version of the engine
doesn't support.
See http://dev.mysql.com/doc/refman/5.5/en/ ... oting.html
how you can resolve the problem.

I looked at the file they recommend but it's over my head. I'm more of a designer than I am a developer. Can anyone help?
tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04

Re: Unable to connect to DB

Postby JonB » 30. July 2012 18:26

Did you have a previous version of XAMPP installed?

If yes,
what version of XAMPP
how did you install XAMPP 1.8.0

If no prior XAMPP
how did you import your data

:?:

Good Luck





ysf
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Unable to connect to DB

Postby tryin_to_learn » 30. July 2012 18:44

Yes - I don't remember the version number but it had PHP 5.2.6.6. Unfortunately, I didn't read the posts here about what to do to install 1.8.0 until after I had already tried to install the new one. Here's what I did:

Copied the htdocs folder to my desktop just in case. Didn't remember to do anything with the databases. Used the uninstall tool to get rid of the previous copy. Said "Yes" to keeping htdocs and the mysql data. At first, I couldn't get MySQL started as a service. That's when I figured I should check the Forum. After reading a bit, I either moved or copied the mysql folder to my desktop - moved, I think, but I wouldn't swear to it. Then I uninstalled again. Then I went to Windows uninstall to see if the mysql service was there. It wasn't. So I reinstalled 1.8.0 and this time the MySQL service started just fine. However, I'm still not able to connect to it with the application I'm developing - just via PHPMyAdmin.

I used the installer each time to install XAMPP.
tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04

Re: Unable to connect to DB

Postby tryin_to_learn » 30. July 2012 19:20

I remembered a bit more and this may be the crucial part: I DID move (not copy) the mysql folder to my desktop. Thought that might help the mysql service install. Once I had the new install complete and the mysql service working, I copy/pasted each of the DB folders to the new mysql/data folder. Nothing was exported/imported the way it should have been. So that's probably the problem - how do I fix it?
tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04

Re: Unable to connect to DB

Postby JonB » 30. July 2012 19:47

two things "might" work -

BEFORE you do either, make sure you have an 'as it was copy' of the old mysql\data folder. So if the only copy of mysql\data is in the new XAMPP copy it out somewhere safe.

1st possibility -

READ THIS - like the stuff you didn't read b4, LOL It tells you what will happen

http://dev.mysql.com/doc/refman/5.5/en/ ... grade.html

Fire up the current version of XAMPP. make sure MySQL is running.
Open a command window

go to the \xampp\mysql\bin folder

Code: Select all
cd \xampp\mysql\bin
mysql_upgrade -p yourrootpassword


standby to pay attention
copy out any notations
Code: Select all
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\JonB>cd \xampp\mysql\bin

C:\xampp\mysql\bin>mysql_upgrade -p xxxyyyzzz
Looking for 'mysql.exe' as: C:\xampp\mysql\bin\mysql.exe
Looking for 'mysqlcheck.exe' as: C:\xampp\mysql\bin\mysqlcheck.exe
Running 'mysqlcheck with default connection arguments



NO WERKY?

2nd. method -

you should re-install the prior version in a different folder.

stop the current version

copy the datafiles (MySQL) into the data folder on old version.

fire up old version

use phpmayadmin to export the MySQL files.


Good Luck
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Unable to connect to DB

Postby tryin_to_learn » 31. July 2012 02:21

And . . . if neither of these things works? It also occurred to me that I have a working copy on my Mac so I exported the DB on the Mac and imported it to my Win machine. Still no go.
tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04

Re: Unable to connect to DB

Postby JonB » 31. July 2012 03:19

hmmmm -

I have now read through everything twice - in whatever data folder belongs to the database involved (there's a folder for each DB you have set up.)

shrink_office/submissionhistory <= is shrink_office a DB, and submissionhistory a table within it?

Look at the other tables and see what is missing for submissionhistory

Does you app/DB work correctly on the Mac? - then all is not lost. What MySQL version is on the Mac?

read-um well here -
http://dev.mysql.com/doc/mysql-backup-e ... ackup.html
and
http://dev.mysql.com/doc/refman/5.5/en/ ... ables.html

I 'think' you need to match the XAMPP/Windows version as closely as you can to the MySQL version on your Mac. Then do a squeaky clean install of that version and get things working via export/import.

There is another tool that might help in some fashion and it works both on Mac & Windows - I use it all the - AND ITS FREE!
http://www.mysql.com/products/workbench/

good Luck - this is all I can grok at the moment.
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Unable to connect to DB

Postby tryin_to_learn » 31. July 2012 03:53

JonB wrote:
shrink_office/submissionhistory <= is shrink_office a DB, and submissionhistory a table within it?

Look at the other tables and see what is missing for submissionhistory


Ooooh - that may have been misleading. Yes, shrink_office is the DB and submissionhistory is ONE of the 50 tables within it. I had similar error messages for each table - right down the line. I just put one up as an example.

JonB wrote:Does you app/DB work correctly on the Mac? - then all is not lost. What MySQL version is on the Mac?


Yes - it does. The Mac has MySQL 5.1

Ok. I'll go read-um for awhile now. :)
tryin_to_learn
 
Posts: 54
Joined: 18. January 2007 16:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 92 guests