 |
 |
Copying MySQL installation..
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Aug 2000
Location: Birmingham, UK
Status:
Offline
|
|
Hi,
I know very little about Terminal commands and that kind of thing, but I have been able to set up Apache, MySQL and PHP on Panther. However, MySQL recently stopped working on my iMac with the infamous can't connect to /tmp/mysql.sock error. In my attempts to get it back up and running I believe I have totally messed it up. My iBook had the same problem too, but I found a solution that got that working (something to do with permissions I think).
My question is, can I somehow take the working MySQL installation that is on my iBook and copy it onto my iMac (having removed the duff installation first of course)? If so, what would I need to do?
Thanks in advance,
Matt
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status:
Offline
|
|
mysqldump is your friend!
From the terminal on the iBook, navigate to your user's document folder (as good a place as any) and perform the following:-
Code:
%> mysqldump -uroot -p > backup.sql
This outputs a great big long text file full of all the SQL commands needed to recreate your database. Simply copy this file 'backup.sql' to your iMac, then from the iMac, navigate to the folder where you copied this file and perform:-
Code:
%> mysql -uroot -p < backup.sql
This simply directs the contents of this backup file to the MySQL command line and VOILA! yer done!
|
|
Computer thez nohhh...
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Aug 2000
Location: Birmingham, UK
Status:
Offline
|
|
I'm not really sure that's what I want to do - it's not the data that I need to copy - it's the actual mysql installation itself as I can't seem to get it to work on the iMac. Can I just copy the relevant files to get a working mysql on the iMac?
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status:
Offline
|
|
Originally posted by mattmac:
I'm not really sure that's what I want to do - it's not the data that I need to copy - it's the actual mysql installation itself as I can't seem to get it to work on the iMac. Can I just copy the relevant files to get a working mysql on the iMac?
Sorry, my misunderstanding.
I wouldn't try to copy the installation verbatim, as it's not good practice (I believe) to run executable compiled for one machine to another where subtle differences can occur. Someone can put me right if I'm speaking waffle here, but I just like to play it on the safe side whenever I'm installing something from the command line.
Which MySQL installation did you use? Did you use the executables from www.mysql.com? Or did you use the ones from Server Logistics? I believe the ones at www.mysql.com are pretty much identical to the ones from www.entropy.ch/macosx/ which Marc has been maintaining for quite some time.
Make sure you have stopped all the mysql processes (try mysqladmin shutdown and it will tell you immediately if something is still active). Try and locate the folder your mysql was installed in. If it was the 'Server Logistics' then it will probably be under /Library/MySQL - if it is the mysql.com version then it's probably something like /usr/local
Back up your data first - think safety right!
Remove the whole mess by executing the command
Code:
%> sudo rm -rf mysql*
... now go back and double-check the install docs. I don't mean to be patronising, it's just that I muffed up a couple of installs myself by missing a vital step (like running the initialisation script, or forgetting to add users, etc...)
More than happy to help out with the install process if you get stuck again!
Cheers
|
|
Computer thez nohhh...
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Dec 2002
Status:
Offline
|
|
I wouldn't recommend trying to copy the install, just use the Server Logistics package.
About the "run executable compiled for one machine," this does not affect this situation as both machines are PPC and the install is a binary one (no compiling is taking place).
Thanks for the mysqldump tip, I had no idea.
|
|
Travis Sanderson
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Aug 2000
Location: Birmingham, UK
Status:
Offline
|
|
Thanks for all the tips guys, will have another bash at it later! Incidentally it was the pkg from entropy.ch that I used, I've tried using the remove-old-mysql from that site and reinstalling, but no joy, would using the rm -rf command remove it more completely?
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|