Subscribe to How-To Geek Mag-subscribe sa Paano-Upang Geek

Important! This is an automatic machine translated page. If you can read english, you should Click Here to read the original English version of the article.

Dump just the table structure to a file in MySQL Tambakan ng basura lang sa table na istraktura sa isang file sa MySQL

For this exercise, we will use the mysqldump utility the same as if we were Para sa ehersisyo, gagamitin namin ang mga mysqldump utility na katulad ng kung tayo ay backing up the entire database. Pag-back up ang buong database.

Syntax: Syntax:

mysqldump -d -h localhost -u root -pmypassword databasename > dumpfile.sql mysqldump-d-h localhost-u root-pmypassword databasename> dumpfile.sql

The only option that is different than creating an entire backup is the -d switch, which tells mysqldump not to output the data. Ang tanging option na naiiba kaysa sa paggawa ng isang buong backup ang-d lumipat, na nagsasabi mysqldump hindi output ng data.

Example: Halimbawa:

mysqldump -d -h localhost -u root -p2Uad7as9 database01 > dumpfile.sql mysqldump-d-h localhost-u root-p2Uad7as9 database01> dumpfile.sql

This article was originally written on 09/11/06 Tagged with: Ang artikulong ito ay orihinal na isinulat sa 09/11/06 Tagged with: MySQL MySQL

Daily Email Updates Araw-araw na Updates Email

You can get our how-to articles in your inbox each day for free. Maaari kang makakuha ng aming kung-paano na mga artikulo sa iyong inbox sa bawat araw para sa libre. Just enter your name and email below: Ilagay lamang ang inyong pangalan at email sa ibaba:


Name: Pangalan:
Email: Email:

Comments (4) Comments (4)

  1. Girish Girish

    --
    –Use this to take only the Table structure of the database table in Linux – -Gamitin ito upang kumuha lamang ang Table structure ng database ng lamesa sa Linux --

    On the terminal Sa terminal
    [root@localhost ~]# mysqldump -uroot -proot123 -h200.200.200.12 mydatabasename tbl_mytable_name –no-data > /tmp/tbl_mytable_name_dump.sql [root @ localhost ~] # mysqldump-uroot-proot123-h200.200.200.12 mydatabasename tbl_mytable_name-no-data> / tmp / tbl_mytable_name_dump.sql

    Remember , if u dont redirect it to a file, it will stores the dump at pwd by the name “oot” Tandaan, kung u dont redirect ito sa isang file, ito ay ang mga tindahan ng tambakan ng basura sa pwd sa pamamagitan ng pangalan na "oot"

    Regards, Pagbati,
    Girish Girish :-)

  2. Girish Girish

    u can restore it in the database using ,,,, u maaari ibalik ito sa database na gamit,,,,
    mysql > source /path/to/a/dump/file MySQL> source / path / na / a / tambakan ng basura / file

  3. shravan shravan

    Thanks. Salamat. It helps! Ito ay nakakatulong na!

  4. scrumpyjack scrumpyjack

    ok, say you have two dbs very similar in structure. ok, sabihin mayroon kang dalawang dbs halos katulad sa istraktura. one you use as a master template which goes through various revisions, let's say we're now on revision 3. isa gumamit ka ng isang master ng template kung saan ang papunta sa pamamagitan ng iba't-ibang mga pagbabago, sabihin natin na kami ngayon sa mga pagbabago 3. but the second db is a copy of the template as it was at revision 1. ngunit sa ikalawang db ay isang kopya ng mga template na ito ay sa pagbabago 1.

    because db 2 is in use, you don't want to drop any tables, but you do need to update the structure of the entire db to the latest version of db 1. dahil db 2 ay sa paggamit, hindi mo nais na drop ng anumang mga talahanayan, ngunit kailangan mong i-update ang structure ng buong db sa pinakabagong bersyon ng db 1.

    is there any method of doing this without having to manually go through and make all the same changes again and again (over many dbs at various versions) and without losing any of the data? ay may anumang mga paraan ng paggawa nito nang hindi na sa mano-mano sa pamamagitan ng pumunta at gumawa ng lahat ang parehong mga pagbabago muli at muli (sa paglipas ng maraming dbs sa iba't ibang mga bersyon) at walang anumang pagkawala ng data?


Leave a Comment Iwanan ng isang Puna




Leave your Iwanan ang iyong mga friendly friendly comment here. puna dito.

If you have a computer help question, Kung ikaw ay may isang computer ng tulong tanong, click here to leave it on the forums i-click dito upang mag-iwan ito sa forums instead. sa halip ng.

Note: Your comment may not show up immediately on the site. Tandaan: Ang iyong puna ay maaaring hindi magpapakita agad sa site.

Our Friends Ang aming mga Friends
Getting Started Pagsisimula


About How-To Geek Tungkol sa Paano-Upang Geek
What Is That Process? Ano ba ang Proseso Iyon?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe dwm.exe
ctfmon.exe ctfmon.exe
wmpnetwk.exe wmpnetwk.exe
wmpnscfg.exe wmpnscfg.exe
rundll32.exe rundll32.exe
wfcrun32.exe wfcrun32.exe
Ipoint.exe Ipoint.exe
Itype.exe Itype.exe
Wfica32.exe Wfica32.exe
Mobsync.exe Mobsync.exe
conhost.exe conhost.exe
Dpupdchk.exe Dpupdchk.exe Adobe_Updater.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. Copyright © 2006-2009 HowToGeek.com. All Rights Reserved. All Rights Reserved.