Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
05-01-2011, 08:32 PM
|
#1
|
Member
Registered: May 2004
Location: Canada
Distribution: SUSE 9.3
Posts: 132
Rep:
|
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!
|
|
|
05-01-2011, 09:48 PM
|
#2
|
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
|
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.
|
05-02-2011, 10:29 AM
|
#3
|
LQ Newbie
Registered: May 2011
Location: Algiers
Distribution: Centos, Ubuntu, RedHat
Posts: 3
Rep:
|
Try to do what frankbell say with PHPMYSQL, is very user friendly
|
|
0 members found this post helpful.
|
05-02-2011, 11:25 AM
|
#4
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,415
|
Quote:
Originally Posted by moumoud
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.
|
|
|
05-02-2011, 11:49 AM
|
#5
|
Member
Registered: Feb 2009
Posts: 68
Rep:
|
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.
|
05-02-2011, 02:27 PM
|
#6
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,415
|
Quote:
Originally Posted by struct
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.
|
|
|
All times are GMT -5. The time now is 08:56 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|