If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > How to copy Database to another server

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-03-08, 23:39
daimous daimous is offline
Registered User
 
Join Date: Sep 2005
Posts: 72
How to copy Database to another server

Hi guys! Help please. Say, I have 2 servers, one is my server that I used during my development and the other one is my client’s server. Say, I’m already done with my development and I want to copy the database from my server to my client’s server what is the best way to do this? I’ve already tried using the “mysqldump.exe” command from MySql Command Line and I was able to backup my database from my development server but when I try to restore it to my client’s server it gives me an error saying
Quote:
“ERROR 1049 (42000): Unknown database 'acr128demo”.
I know the error is obvious but im just wondering if I could restore a dabatase to a server even if the database does not exist. Any help guys? by the way this is how i backup my database
Quote:
mysqldump.exe --add-drop-database -u root -p MyDBName > c:\Filename.mysql
and restore it to my client's server
Quote:
mysql.exe -u root -p MyDBName < e:\Filename.mysql
Reply With Quote
  #2 (permalink)  
Old 07-04-08, 03:16
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
either create a db on the client machine called acr128demo
or find if their is an option to set a target database
or do the backup via mysql administrator where you cn then edit the database name.
looking at the option in mysqldump you can output values to XML, so im guessing you can make changes to the XML file before loading the data into the target file.

its probably quite likely that MySQL administrator uses mysqldump to do the dirty deed, adminsitrator creates a .SQL file which is editable by any ascii editor, allthough some may choke if the .sql file is fairly massive

if none of thoise work the other alternative is to create a copy of the db in the new name within your test server
then run mysqldump on the copy and use that as your feedstock on the live server.

personally I don't like having different names between the live and test servers.. its just one more thing to test on deployment in the ive environment
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 07-07-08, 03:24
ankur02018 ankur02018 is offline
Registered User
 
Join Date: Jun 2007
Posts: 189
Smile

this error show that before importing the file you have not created database
first create database import file

or you can use Navigate tool for this purpose
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On