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 Savivartis tik lentelės struktūrą MySQL failą

For this exercise, we will use the mysqldump utility the same as if we were Už šį darbą, mes naudosime mysqldump naudingumas pats kaip jei mes backing up the entire database. kopijavimas visą duomenų bazę.

Syntax: Sintaksė:

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. Vienintelė alternatyva, kuri skiriasi ne kurti visa atsarginė D jungiklis, kuris pasako mysqldump ne išvesties duomenis.

Example: Pavyzdys

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: Šis straipsnis buvo parašytas ant 09/11/06 Tagged with: MySQL MySQL

Daily Email Updates Dienos paštas Atnaujinimai

You can get our how-to articles in your inbox each day for free. Galite gauti mūsų kaip prie straipsnių į Jūsų pašto dėžutę kasdien nemokamai. Just enter your name and email below: Tiesiog įveskite vardą ir elektroninio pašto adresą žemiau:


Name: Vardas:
Email: Paštas:

Comments (4) Komentarai (4)

  1. Girish Girish

    --
    –Use this to take only the Table structure of the database table in Linux – Naudojimo tai užtruks tik lentelės struktūrą, duomenų bazės lentelę Linux --

    On the terminal 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” Atminkite, if u dont nukreipti jį į failą, jis bus parduotuvėse dump ne pwd pavadinimu "oot"

    Regards, Linkėjimai,
    Girish Girish :-)

  2. Girish Girish

    u can restore it in the database using ,,,, U gali atkurti duomenų bazę, naudojant,,,,
    mysql > source /path/to/a/dump/file mysql> source / path / to / / dump / failą

  3. shravan shravan

    Thanks. Ačiū. It helps! Jis padeda!

  4. scrumpyjack scrumpyjack

    ok, say you have two dbs very similar in structure. Gerai, tarkime, jūs turite dvi DBS struktūra labai panaši. one you use as a master template which goes through various revisions, let's say we're now on revision 3. viena naudoti kaip šabloną, kurį kapitonas eina per įvairių versijų, tarkim mes dabar peržiūrima 3. but the second db is a copy of the template as it was at revision 1. bet antra db yra šablonas, nes ji buvo peržiūrima 1 kopiją.

    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. nes db 2 yra naudojamas, jūs nenorite atsisakyti bet lenteles, bet jums reikia atnaujinti visą DB struktūra naujausią BP 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? Ar galima tai padaryti be būtinybės rankiniu būdu pereiti ir padarys viską, tie patys pakeitimai vėl ir vėl metodu (per daug DBS įvairiomis kalbomis) ir neprarandant duomenų?


Leave a Comment Palikite komentarą




Leave your Palikite friendly draugiškas comment here. komentarus.

If you have a computer help question, Jei turite kompiuteryje Pagalba klausimą, click here to leave it on the forums Spauskite čia, jei norite palikti jį dėl forumai instead. vietoj.

Note: Your comment may not show up immediately on the site. Pastaba: Jūsų komentaras gali būti rodomas iš karto svetainėje.

Our Friends Mūsų draugai
Getting Started Paruo


About How-To Geek Apie How-To Geek
What Is That Process? Kas yra šis procesas?
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.