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 Výpisom len štruktúry tabuľky do súboru v MySQL

For this exercise, we will use the mysqldump utility the same as if we were Pre toto cvičenie budeme používať nástroj mysqldump rovnaké, ako keby sme backing up the entire database. zálohovanie celej databázy.

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. Jedinou možnosťou, ktorá je iná, ako vytvoriť kompletnú zálohu, je prepínač-d, ktorý hovorí, mysqldump, aby výstup dát.

Example: Príklad:

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: Tento článok bol pôvodne napísaný na 09/11/06 Tagged s: MySQL MySQL

Daily Email Updates Denný Svářeč

You can get our how-to articles in your inbox each day for free. Môžete si naše jak-na články vo vašej schránky každý deň zadarmo. Just enter your name and email below: Stačí zadať svoje meno a e-mail nižšie:


Name: Meno:
Email: E-mail:

Comments (4) Komentáre (4)

  1. Girish Girish

    --
    –Use this to take only the Table structure of the database table in Linux – -Pomocou tohto brať len štruktúru tabuľky databázy tabuľky v Linuxu --

    On the terminal Na termináli
    [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” Pamätajte si, že ak u dont presmerovať do súboru, bude sa ukladá na skládku pwd s názvom "oot"

    Regards, Pozdravy,
    Girish Girish :-)

  2. Girish Girish

    u can restore it in the database using ,,,, u možno obnoviť v databáze pomocou,,,,
    mysql > source /path/to/a/dump/file mysql> source / cesta / k / / dump / archív

  3. shravan Shravan

    Thanks. Vďaka. It helps! To pomáha!

  4. scrumpyjack scrumpyjack

    ok, say you have two dbs very similar in structure. ok, že máte dve dbs veľmi podobnú štruktúru. one you use as a master template which goes through various revisions, let's say we're now on revision 3. tou, ktorú používate ako hlavný šablónu, ktorá prechádza rôznymi revíziami, povedzme, že sme teraz na revíziu 3. but the second db is a copy of the template as it was at revision 1. ale druhý db je kópia šablóny, ako to bolo u revízie 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. pretože db 2 je v prevádzke, nechcete, aby nepokračoval tabuľky, ale je potrebné aktualizovať štruktúru celej db na najnovšiu verziu 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? Je nejaký spôsob, ako to dosiahnuť, bez toho aby museli prejsť ručne a všetky rovnaké zmeny znovu a znovu (po mnohých dbs na rôznych verzií) a bez straty dát?


Our Friends Naši priatelia
Getting Started Začíname


About How-To Geek O tom, ako-To Geek
What Is That Process? Čo je to za proces?
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.