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 Volcat només l'estructura de la taula a un arxiu en MySQL

For this exercise, we will use the mysqldump utility the same as if we were Per a aquest exercici, utilitzarem la utilitat mysqldump el mateix que si ens backing up the entire database. còpies de seguretat de la base de dades completa.

Syntax: Sintaxi:

mysqldump -d -h localhost -u root -pmypassword databasename > dumpfile.sql mysqldump-d-h localhost-u root-databasename pmypassword> 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. L'única opció que és diferent a la creació d'una còpia de seguretat completa és el modificador-d, que diu que no mysqldump per generar les dades.

Example: Exemple:

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: Aquest article va ser originalment escrit en 09/11/06 Tagged amb: MySQL MySQL

Daily Email Updates Daily Email Updates

You can get our how-to articles in your inbox each day for free. Vostè pot obtenir el nostre com-als articles a la teva safata d'entrada cada dia de forma gratuïta. Just enter your name and email below: Només cal que introdueixis el teu nom i correu electrònic a continuació:


Name: Nom:
Email: Email:

Comments (4) Comentaris (4)

  1. Girish Girish

    --
    –Use this to take only the Table structure of the database table in Linux – -Feu-la servir per prendre només l'estructura de la taula de la taula de la base de dades a Linux --

    On the terminal En el 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 tbl_mytable_name mydatabasename-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” Recordeu, si o no redirigir a un arxiu, s'emmagatzema a l'abocador de persones amb discapacitat pel nom de "oot"

    Regards, Records,
    Girish Girish :-)

  2. Girish Girish

    u can restore it in the database using ,,,, o pot restaurar a la base de dades utilitzant,,,,
    mysql > source /path/to/a/dump/file mysql> source / ruta / a / a / descàrrega / arxiu

  3. shravan Shravan

    Thanks. Gràcies. It helps! Ajuda!

  4. scrumpyjack scrumpyjack

    ok, say you have two dbs very similar in structure. OK, diguem que té dues DBS molt similar en la seva estructura. one you use as a master template which goes through various revisions, let's say we're now on revision 3. que s'utilitza com un mestre de la plantilla que va a través de diverses revisions, diguem que estem ara en la revisió 3. but the second db is a copy of the template as it was at revision 1. però el PP segon és una còpia de la plantilla com estava en la revisió 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. perquè dB 2 està en ús, no vol abandonar les taules, però és necessari actualitzar l'estructura de tot el PP a l'última versió d'1 dB.

    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? Hi ha algun mètode per fer-ho manualment sense haver de passar per totes i fer els mateixos canvis una i altra vegada (més de DBS en moltes versions diferents), i sense perdre cap de les dades?


Our Friends Els nostres Amics
Getting Started Com començar


About How-To Geek Sobre How-To Geek
What Is That Process? Què és aquest procés?
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 Jusched.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. Tots els drets reservats.