ss_blog_claim=a37b70f67cd872812717e1fce7e83301
Latest Posts »
Latest Comments »
Popular Posts »

Dump Data mySQL Command

Written by techieDan on February 25, 2008 – 9:09 pm

You’re stuck in a new place, with no Internet connection and you have no extra additional softwares to install for GUI for mySQL updates and stuffs. Now then suddenly the client asked you to backup his database using the UNIX server. You, as a fresh database administrator suddenly felt lost and don’t know what to do.

If only everyone have learnt the basics of command line prompt, one will not have panic like the above scenario. How to backup your mysql database using command line prompt.

Windows Environment for simplicity

C:\> [MYSQL HOME]\bin\ mysqldump -u[user] -p [databasename] > something.ddl

Yes, a single line and it’s all done.

What does this line meant?

Legend
-u user option
root default username
-p password option

The rest is pretty understandable
Example if I have a username ‘root’ for the database and password ‘abc’ with the database name called db and I wanted to save all the data onto a file name data.ddl, this is what I would write below.

mysql backup

If you have any questions pertaining this issue, do drop a line.


Tags: ,
Posted in SQL | No Comments »

Copy Folders in DOS

Written by techieDan on January 25, 2008 – 7:59 am

Your Windows OS (Operating System) is down. Dang… and you need a data seriously that you don’t want to bother installing another windows. So how do you do it. Yes, one can copy files using the DOS command.
Let’s say you’re in the command prompt c:\>

C:\> copy *.* a: (copies all file in the current folder you’re in into a: drive

Now you wanted to copy multiple folders for backup purposes onto another folder. This is the way one should do

C:\> xcopy foldername foldername copies all the folders and files inside into another folder

Now let’s say example from folder C:\>techiedan\ and all it’s subdirectories, I want to copy all this into another folder name C:\>blog\techiedan\.

C:\> xcopy techiedan blog\techiedan /e copies all the folders and files inside into another folder (use the /e for copying all folders and files)
  use alternatively the /i if you have lots of folders so DOS won’t keep on asking whether content is a file or folder

DOS Copy XCopy Screenshot

Now you know this, so with this knowledge, you can start writing a schedule or a batch file to run this script at certain period to backup your files. :)


Tags: , ,
Posted in DOS | No Comments »