The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   OS X Developer (http://hintsforums.macworld.com/forumdisplay.php?f=27)
-   -   MySQL File On Desktop (http://hintsforums.macworld.com/showthread.php?t=29303)

sharingsunshine 10-18-2004 04:16 PM

Thanks for the answers. I am a bit confused about using the word terminal.

I am using a Macintosh and we have a program called terminal that does similar to shelling a server. When I gave you the answers I gave them from the terminal on the Mac.

Are you saying I have to have a copy of MySQL on the Mac? I put the file on the server but in an earlier post (see below) I got the same error.

****************

I copied the file to the server but I still get the same error.

mysql> use old12all
Database changed
mysql> RESTORE TABLE ListMembers FROM '/home/virtual/thefrugallife.com/var/www/html/12all/backups/1089048410_Mon,05-07-2004.sql';
+-------------+---------+----------+--------------------------+
| Table | Op | Msg_type | Msg_text |
+-------------+---------+----------+--------------------------+
| ListMembers | restore | error | Failed copying .frm file |
+-------------+---------+----------+--------------------------+
1 row in set (0.77 sec)

Could it be something about the location. I am not sure where to start from so I started from the root?

***********

Once we clarify which device to use shell or terminal, just let me know what answers you need.

I appreciate all your help.

Randal

acme.mail.order 10-18-2004 11:28 PM

I think I see the problem now. You are using the RESTORE command to read a DUMP file. RESTORE looks for two files, so it fails looking for `*.frm`

Replace the RESTORE line with
Code:

source /home/virtual/thefrugallife.com/var/www/html/12all/backups/1089048410_Mon,05-07-2004.sql;

acme.mail.order 10-18-2004 11:39 PM

And yes, when anyone here says "Terminal" we mean the shell program of that name - although you can run any shell you want within that window.

Newbish 10-19-2004 09:12 AM

Additionally, MacOS X does have MySQL installed. Well, depending on the version of the OS you are running. However, that doesn't necessarily mean that MySQL is actually running.

typing ps -caux | grep mysql should result in a line showing the process mysqld running if MySQL is active. If you have rebooted your machine, MySQL will not be active by default.

To start MySQL, as root user type mysqld_safe &.

There are several threads on MacOSXHints about working with MySQL on a Mac. I only bring it up on this thread because it may help you in working this issue out on your Mac before loading it into a live database.

Acme, I was wholly unaware of the source command in MySQL and I was unable to find reference to it in the mysql.com online reference manual. If you could point out any references I could read, I'd really appreciate it. Thanks!

I tried it again on Randall's sample and can confirm that it worked as expected.

acme.mail.order 10-19-2004 09:35 AM

I can't find it in the online manual either - just a billion references to source code.

However, if we return to the Dark Ages and simply type `help` at the mysql prompt, there it is.

source (\.) Execute a SQL script file. Takes a file name as an argument.

Pretty stone-simple - start where we are, do what's in the file as if it was typed at the prompt.

sharingsunshine 10-21-2004 06:50 PM

The source command did the trick and it loaded the entire dump which was more than just the one table - Quick!

Thanks so much for all of your help.

Randal


All times are GMT -5. The time now is 05:45 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.