LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-08-2009, 02:50 AM   #1
vous
Member
 
Registered: Mar 2003
Location: Macondo
Distribution: Mandrake 9.1, 10.1, SuSE 8.1 pro, 10.1, Red Hat 8.0/9.0
Posts: 380

Rep: Reputation: 30
Copy MySQL database with PHPMyAdmin....how?!?!?


Hello All,

1) I have a database in my test environment called TEST_DB.
2) I need to make an exact copy of this database (TEST_DB) in my production environment but I h-a-v-e to use the name LIVE_DB.

How do I do this?

Any ideas...?
 
Old 09-08-2009, 11:18 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 23,815

Rep: Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974Reputation: 6974
Quote:
Originally Posted by vous View Post
Hello All,

1) I have a database in my test environment called TEST_DB.
2) I need to make an exact copy of this database (TEST_DB) in my production environment but I h-a-v-e to use the name LIVE_DB.

How do I do this?

Any ideas...?
Yes. Don't use phpmyadmin. It's better to use the command-line tools, in my opinion. mysqldump can take a snapshot and restore it easily, and you don't even have to shut down the database to do it.

For backup:
Code:
mysqldump -u root TEST_DB > TEST_DB.sql
That dumps the test_db into that .sql file. To restore, copy the file onto your production server, and:

Code:
mysql -u root -e "create database LIVE_DB"
mysql -u root -D LIVE_DB < TEST_DB.SQL
That's it. Feel free to substitute the root user, with whatever mysql user you feel appropriate, or add a password if you need one. The man pages should tell you what you need to know.
 
  


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
mysql phpMyAdmin - attach files to database superevilspacemonkey Linux - Software 1 04-24-2009 02:20 PM
How can i copy the MySQL database? halvorls Linux - Server 3 08-14-2008 12:59 PM
copy one mysql database into another Peter Shepard Ubuntu 1 02-11-2008 06:29 PM
fixing mysql database table without phpmyadmin c0c0deuz Linux - Server 3 12-01-2007 08:17 PM
How do I make a copy of mysql database intale(located) on linux server jenny1668 Linux - Newbie 1 10-02-2006 07:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:13 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