mysql.proc error when trying to import

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

mysql.proc error when trying to import

Postby mactfines » 15. February 2006 23:31

I have exported an sql db from another system using mysqldump.
When I try to import into the XAMPP MySQL db, I get this error:
ERROR 1146 (42S02) at line 12: Table 'mysql.proc' doesn't exist

A Google search found this bug and suggested fix:
http://bugs.mysql.com/bug.php?id=9496

The posted bug has a posted workaround, and it says the problem that caused this was fixed in MySQL 5.0.4. My XAMPP 0.5 installation for OS X is using MySQL 5.0.15.

I tried just recreating the MySQL db by first renaming the /Applications/xampp/xamppfiles/var/mysql to /Applications/xampp/xamppfiles/var/mysql_old then running the mysql_install_db --default-table-type=MyISAM command. It recreates the mysql database, but messes something else up, because the XAMPP Status page now shows 'DEACTIVATED' for status, and shows MySQL security as 'UNKNOWN'.

How do I fix this problem without breaking the XAMPP MySQL installation?

Thanks,
Ted
mactfines
 
Posts: 2
Joined: 15. February 2006 18:55

Got it to work, hope this solution is OK...

Postby mactfines » 17. February 2006 16:02

My exported database btw was MediaWiki (http://www.mediawiki.org), running my MySQL 4.1.11 on Linux. Here's how I imported it into XAMPP on OSX/MySQL 5.0.15 and got it working.

1. Get another installation of MySQL (the same or close to the same as the version with XAMPP) installed. My XAMPP MySQL was 5.0.15 and the other installation I created was 5.0.18 and it worked for me. YMMV. The other installation doesn't have to be on the same box. I installed 5.0.18 on a Windows box.
2. Start MySQL on the other box, so it does the normal initialization of tables stuff and creates the defaults.
3. Export two tables from it with:
mysqldump --user=root mysql proc > proc.sql
and
mysqldump --user=root mysql procs_priv > procs_priv.sql

4. FTP or otherwise somehow transfer these two files to your XAMPP system.
5. Edit the files. For both, right before the "DROP TABLE IF EXISTS 'proc';" line, insert this line: "USE mysql;"
So proc.sql at the top should look like:
--
-- Table structure for table `proc`
--
USE mysql;
DROP TABLE IF EXISTS `proc`;

And procs.priv.sql at the top should look like:
--
-- Table structure for table `procs_priv`
--
USE mysql;
DROP TABLE IF EXISTS `procs_priv`;

6. Import these tables into your XAMPP database:
mysql --user=root --password=****** < proc.sql
mysql --user=root --password=****** < procs_priv.sql

After doing this, I was able to import my exported file from the other system with no errors, and everything worked. Well, I did have to create a db user in my XAMPP db with the same privs as in the old one. I did this with:
mysql> GRANT ALL PRIVILEGES ON <dbname> TO 'wikiuser'@'localhost' IDENTIFIED BY '<wikiuser password>';

I also had to edit some of the settings in the LocalSettings.php file. I had to set the $IP variable at the very top to point to the correct path on the new host. I also had to edit the $wgScriptPath variable to point to the new path. (On the old host, the DNS name had a vhost in apache so the path was blank, but on the new one, it's in /wiki so I had to set "wgScriptPath" to "/wiki".)

So knowing nothing about MySQL, why does the default XAMPP install of MySQL not have these tables?

Is there any reason why adding these tables is a bad idea?
[url][/url]
mactfines
 
Posts: 2
Joined: 15. February 2006 18:55


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: davidbankys and 3 guests