LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-03-2004, 06:37 PM   #1
E-Oreo
LQ Newbie
 
Registered: Dec 2002
Posts: 24

Rep: Reputation: 15
Transfering a large MySql database


I was wondering if anyone has any tips on moving a large MySql database. I switched servers and I need to transfer a 10 megabyte table from one server to the other. PhpMyAdmin stalls when you ask it to run a 10Mb file, what other ways are there to transfer a database from one server to another?
 
Old 06-03-2004, 07:58 PM   #2
ricstirato
Member
 
Registered: Jan 2004
Location: Gießen, Germany
Distribution: Xubuntu 12.04, Mythbuntu, Ubuntu Server 12.04
Posts: 174

Rep: Reputation: 24
Right, phpMyAdmin is very slow and has also a (configurable iirc) limit for the SQL file's size.

You simply can use the command line client. It's much faster and does not care about the file's size.

Assuming you already created the database on the destination system, do:

mysql -u username -p database_name < sql_dump_file

You will be prompted for the password and on it goes.
If you don't use a password for the user, omit the "-p"
 
Old 06-03-2004, 08:06 PM   #3
E-Oreo
LQ Newbie
 
Registered: Dec 2002
Posts: 24

Original Poster
Rep: Reputation: 15
Ok, I just have a few questions.

Where do I run this, in the CLI of my local computer? If so where do I tell it what host to use.

I only need to dump one table, is there any way to do that?

After I have the dump downloaded to my local computer how do I upload it back onto the other server?

Thanks for the help,
Tim
 
Old 06-04-2004, 08:15 AM   #4
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Quote:
Where do I run this, in the CLI of my local computer?
This is your choice, but if you have shell access to the host running the database, you get better performance doing it there.

Quote:
If so where do I tell it what host to use.
mysql -u username@hostname -p database_name < sql_dump_file

Quote:
I only need to dump one table, is there any way to do that?
Read "man mysqldump".

Quote:
After I have the dump downloaded to my local computer how do I upload it back onto the other server?
That was what ricstirato's commandline does. To make the dump use "mysqldump", see its man page.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing an app that uses a mysql database without installing mysql server? QtCoder Programming 4 08-09-2004 03:43 PM
MYSQL help - mysql database missing eloviyandhi Linux - Software 1 03-20-2004 10:20 PM
Backing up large MySQL DB's WeNdeL Linux - Software 5 11-29-2003 10:34 AM
Whiich DBMS for very large database? nakkaya Linux - General 5 03-16-2003 11:38 PM
large database nakkaya Linux - General 1 01-18-2003 10:17 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration