473,396 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Database Backup

lotus18
866 512MB
Hello World!

I created a database here on my pc using mysql and its database engine is innodb. but when i try to copy the its database file to another pc, it says my tables are not existing. And I checked the phpmyadmin and create another table i cannot see innodb engine, myisam is now the default. what maybe the problem? please guide me.

Rey Sean
Jul 12 '08 #1
3 1400
coolsti
310 100+
I would not do a database copy in that manner.

I would use the "mysqldump" function to dump the database that you wish to copy to a file, then copy the file to the other machine, and then read in the database to the new machine using the "mysql" function.

When I use mysqldump to dump just one database (as opposed to more than one), I open the file that is created, and add a "USE mydatabase" as the first line, where mydatabase is substituted with the database name, just to make sure I don't accidentally attempt to add the database tables to the wrong database on the target machine.

On the target machine, you may have to first create the database if it isn't already created. Then you can just read in your file using the command line mysql command:

mysql -u myuser -p mydatabase < myfile.sql

where myuser, mydatabase and myfile.sql are substituted for the user name, the database name, and the file name that you created with the mysqldump.

The above works on Linux, I am not sure if you need to change the command line I show above a bit for Windows, as the "< myfile.sql" part is the Linux way of telling mysql to read commands in from the myfile.sql.
Jul 12 '08 #2
lotus18
866 512MB
When i was using myisam, it works fine when i transfer the file from one pc to another. but in innodb can't. I don't really know mysqldump but I think this is the right option to backup and restore database. Can you give me a better example? Syntax?
Jul 12 '08 #3
coolsti
310 100+
I can't give you an exact syntax example at the moment, but you can easilly find it in the documentation online. Just Google it.

You feed it arguments that state the user name and password, as your credentials for being allowed to make the dump must be checked. You also feed it an argument saying which database or databases you want to dump. You also have optional arguments on whether the dump will be optimized, etc. And lastly you somehow give the filename that the dump should be made to (which again as with mysql, may differ on Windows from Linux in syntax).

The reason why this is safer than copying tables is because doing the mysqldump writes the data in a form that is just a file of sql statements, which then should be able to be read back into a mysql database, either on the same machine or on another machine, as long as there is not too big a difference in mysql versions. When you just make a copy of tables, as you have done for your MyISAM tables, you are just assuming that the tables contain all the information needed for the databases, and that the tables' file structure is equivalent for both machines. I would suspect that Innodb database tables have something that you are not completely copying when you do it that way. Perhaps other associated files or configurations that you don't know about.
Jul 12 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Cristina | last post by:
Hallo i am a beginner into Oracle Technologies.I would like to make backup of my database,but i dont know how.Is there tools?Can i schedule the backup plan? thanks Cristina
2
by: Rajesh Garg | last post by:
I will make it simpler to look... I have DB1 - as backup for day 1 LOg1 as backup of logs T1 T2 T3 T4 T5 ...some transaction on day 2 Now i backup again DB2 Log2
6
by: Edwinah63 | last post by:
Hi Gurus, i am having problems with restoring a ms sql database. i have restored the database using veritas to a different location ('g:\datafiles') in no recover mode. when i view the...
2
by: trotter | last post by:
I want to know if there is a "best-practice" for setting up Database Maintenance Plans in SQL Server 7 or 2000. To be more specific, I want to know the order in which I complete the tasks. Do I...
2
by: Matt | last post by:
I run SQL Server 2000 and use thier database maintenance plans to backup my databases. My questions is what happens if a change is being made to a database table while a backup is running? Should I...
5
by: Hassan Naqvi | last post by:
Hi, Basically, I am Java developer. In past I have played with Oracle using Java (JDBC). But this is the time to play with IBM DB2 using Java (JDBC). So kindly help this DB2 newbie. I have a...
5
by: HSP | last post by:
hi. i need to restore an old database. The db was backed up using a DLT drive, using 2 volumes. The content for the tapes was copied to file onto Solaris machine using rsh and dd (for backup...
5
by: Steve | last post by:
Hi; I thought I would rephrase a question I asked in another post to more quickly get to the heart of the matter. My apologies for anyone who is offended by what appears to be a repetition. ...
3
by: Bill E. | last post by:
I'm trying to restore a database backed up a production machine onto my development machine. I don't want to restore the transaction logs (there are two) because they are far too large and are...
5
by: Roger | last post by:
backup log testdb with truncate_only DBCC SHRINKFILE (testdb_log, 100) WITH NO_INFOMSGS backup database testdb to disk = '\\DC01\Backups\DB01\testdb.bak' with init and does the shrinkfile...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.