image
image

Go Back   macosx.com > Design, Media, Programming & Scripting > Design & Media

Reply
 
LinkBack Thread Tools
  #1  
Old December 23rd, 2002, 10:30 PM
Registered User
 
Join Date: Dec 2002
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
ignatz is on a distinguished road
Uploading MySQL database from my computer to server

Can anybody post (or direct me to a post) directions on uploading my MySQL DB from my computer to the server. I'm using MacOS X Jaguar on my computer (if that makes any difference). The server I will be uploading to is linux.

I would love to have GUI to do this job, but if anybody knows of a good site with really clear directions for doing it through the terminal it would be most appreciated.

Thank you kindly (in advance),

ignatz
Reply With Quote
  #2  
Old December 28th, 2002, 04:22 AM
slur's Avatar
Geek / Hedonist
 
Join Date: Dec 2000
Location: Florence, MA
Posts: 542
Thanks: 0
Thanked 0 Times in 0 Posts
slur is on a distinguished road
The best reference for this is at MySQL.com. Read about the "mysqldump" and "mysqlhotcopy" commands. Typically you'd use mysqldump to export the database to a text file, then use rcp, scp, or ftp to transfer the file to the other server, and then use the "mysql" command with input redirection to import the text file into the database on the destination server.

The approach I describe requires some understanding of shell scripting and how to set up automatic authentication via ftp, rcp, or scp (ssh), so you ought to read up on all that too.

On the other hand there may already be some pre-built solutions for doing just what you want, and I'd expect to find references for such stuff at the MySQL site, and probably at SourceForge.
__________________
|
| slur was here
|

check out my creative music software
Reply With Quote
  #3  
Old December 29th, 2002, 05:58 PM
Registered User
 
Join Date: Dec 2002
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
ignatz is on a distinguished road
thanks slur! I'm still having a hard time with php/mysql, but your tip helped.

thanks!

ignatz
Reply With Quote
  #4  
Old January 2nd, 2003, 01:46 PM
Registered User
 
Join Date: Dec 2002
Location: Little Rock, Ar.
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
podmate is on a distinguished road
A fairly easy way to do it is to use mysqldump (as slur suggested).

Here is example code you can use from the terminal commandline:
mysqldump --opt -p DATABASENAME > filepath/DATABASENAME.sql

--opt adds the most commonly used mysqldump flags
-p requires you to use the password for DATABASENAME

move the file created above to your server.

To read the dumped file into the database on your server is simple, but can cause you loads of problems.

Here is the most common problem (in my experience). The information in the database is OVERWRITTEN by the data being loaded into the database by the mysqldump when using the code below.

from the terminal command line:
cat filepath/DATABASENAME.sql | mysql -p -uroot DATABASENAME

-uroot is telling mysql that you are using a different user called root
you could say -ufred if you wanted to use user freds password. the whole -u thing is optional.
-p requires you to use the password for the database or the password for the specified user.


I looked around for some GUI things to do this for the users that I support. Haven't found one yet.

Good luck.
Reply With Quote
  #5  
Old January 2nd, 2003, 03:40 PM
Registered User
 
Join Date: Nov 2001
Location: Kansas City, MO
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
coolgrafix is on a distinguished road
Is phpMyAdmin available?

If phpMyAdmin is installed on the Linux machine then your chore is ridiculously simple, as you can simply send your mySQL dump text file to the server thru the phpMyAdmin web interface and it will create the database for you. Haven't done this in a while, but unless I'm delerious, it's that simple... provided phpMyAdmin is available. =)
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
geeks vs. computer users edX Opinions, & Open Letters 172 July 25th, 2003 11:21 PM
How do I stop the MySQL server? vikingshelmut Unix & X11 2 February 12th, 2003 09:18 AM
[REQUEST] - HowTo setup startup services on Jaguar (10.2.3) wiz Unix & X11 11 January 17th, 2003 02:47 AM


All times are GMT -5. The time now is 04:18 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
Copyright 2000-2010 DigitalCrowd, Inc.