LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-01-2011, 08:32 PM   #1
stefane321
Member
 
Registered: May 2004
Location: Canada
Distribution: SUSE 9.3
Posts: 132

Rep: Reputation: 15
transfert all mysql database to my new server


Hello,

in my office i have a developpent server in fedora core so the hard drive was full

i bought a new server

noiw i would like to transfert all my database to my new server

how can i do that please?

thanks!
 
Old 05-01-2011, 09:48 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,722
Blog Entries: 28

Rep: Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275
Here's the short version:

Export the existing database in *.sql format.

Create a new empty database on the new server. It would be advisable to create a mysql user fill full rights to that database only, as opposed to having mysql's root administer it.

Import the *.sql file to mysql on the new server.

Here's the long version:

http://dev.mysql.com/doc/refman/5.0/...databases.html
 
1 members found this post helpful.
Old 05-02-2011, 10:29 AM   #3
moumoud
LQ Newbie
 
Registered: May 2011
Location: Algiers
Distribution: Centos, Ubuntu, RedHat
Posts: 3

Rep: Reputation: 0
Try to do what frankbell say with PHPMYSQL, is very user friendly
 
0 members found this post helpful.
Old 05-02-2011, 11:25 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,415

Rep: Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111
Quote:
Originally Posted by moumoud View Post
Try to do what frankbell say with PHPMYSQL, is very user friendly
...except if the OP doesn't have Apache with PHP support installed, then they'd have to set all that up (on two servers), THEN install PHPMYSQL, to use it.

Using the command line is far simpler in this case.
 
Old 05-02-2011, 11:49 AM   #5
struct
Member
 
Registered: Feb 2009
Posts: 68

Rep: Reputation: 10
use this command
Export:
mysqldump -h <IP> -u <user> -p<pass> <databasename> > <outputfile>

Import:
mysql -h <IP> -u <user> -p<pass> <databasename> < <outputfile

example
mysqldump -h 192.168.0.2 -u root -pmyPass database1 > database1.sql

Note: if it's innodb engine, you'll need to add --single-transaction parameter.

Then in the new system, run:

mysql -h 192.168.0.3 -u root -pmyPass database1 < database1.sql

Last edited by struct; 05-02-2011 at 11:51 AM.
 
1 members found this post helpful.
Old 05-02-2011, 02:27 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,415

Rep: Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111
Quote:
Originally Posted by struct View Post
use this command
Export:
mysqldump -h <IP> -u <user> -p<pass> <databasename> > <outputfile>

Import:
mysql -h <IP> -u <user> -p<pass> <databasename> < <outputfile

example
mysqldump -h 192.168.0.2 -u root -pmyPass database1 > database1.sql
Note: if it's innodb engine, you'll need to add --single-transaction parameter.

Then in the new system, run:
mysql -h 192.168.0.3 -u root -pmyPass database1 < database1.sql
+1 for some very good advice.
 
  


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
Load Balancing Database Server (MySQL) Swakoo Linux - General 4 09-12-2009 01:00 PM
How can i copt the MYSQL Database to a other server (Database) halvorls Linux - Server 3 07-27-2008 10:19 PM
Migrate MySQL database to new server babal Linux - Server 4 11-21-2007 02:31 AM
Migrate MySQL database to new server babal LinuxQuestions.org Member Intro 1 11-17-2007 05:45 AM
Writing an app that uses a mysql database without installing mysql server? QtCoder Programming 4 08-09-2004 03:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:56 PM.

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