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 Dump רק מבנה הטבלה לקובץ MySQL

For this exercise, we will use the mysqldump utility the same as if we were עבור התרגיל הזה, אנו נשתמש בכלי mysqldump אותו כאילו היינו backing up the entire database. מגבה את מסד הנתונים כולו.

Syntax: תחביר:

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. האפשרות היחידה זה שונה מאשר יצירת גיבוי כולו הוא-D הבורר, בו הוא מספר על mysqldump לא פלט את הנתונים.

Example: דוגמה:

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: מאמר זה נכתב במקור ב 09/11/06 עם שתייגת: MySQL MySQL

Daily Email Updates שערי עדכונים בדוא"ל

You can get our how-to articles in your inbox each day for free. אתה יכול לקבל כמה שלנו למאמרים לתיבת הדואר שלך בכל יום בחינם. Just enter your name and email below: פשוט להזין את שם ואת הדוא"ל שלך להלן:


Name: שם:
Email: דואר אלקטרוני:

Comments (4) תגובות (4)

  1. Girish Girish

    --
    –Use this to take only the Table structure of the database table in Linux – -השתמש לקחת רק את המבנה של טבלה בטבלה מסד נתונים ב-Linux --

    On the 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-אין נתונים-> / 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” זכור, אם u dont לנתב אותו לקובץ, זה יהיה ה-dump חנויות ב pwd בשם "oot"

    Regards, דרישת שלום,
    Girish Girish :-)

  2. Girish Girish

    u can restore it in the database using ,,,, U יכולים לשחזר אותו במסד הנתונים באמצעות,,,,
    mysql > source /path/to/a/dump/file mysql> המקור / path / to / חור / / קובץ

  3. shravan shravan

    Thanks. תודה. It helps! זה עוזר!

  4. scrumpyjack scrumpyjack

    ok, say you have two dbs very similar in structure. OK, נניח שיש לך שני DBS מאוד דומה מבחינת המבנה. one you use as a master template which goes through various revisions, let's say we're now on revision 3. אחד אתה משתמש כממונה תבנית אשר עובר תיקונים שונים, בואו נגיד שאנחנו עכשיו על תיקון 3. but the second db is a copy of the template as it was at revision 1. אבל db השנייה היא עותק של התבנית כפי שהיה עדכון 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. db 2, כי הוא בשימוש, אתה לא רוצה לרדת כל הטבלאות, אבל אתה צריך לעדכן את המבנה של db כולו לגרסה העדכנית ביותר של 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? האם יש שיטה לעשות זאת מבלי לעבור ידנית ולבצע את כל השינויים שוב ושוב (מעל DBS רבים בגירסאות השונות) ו מבלי לאבד את כל הנתונים?


Leave a Comment השאירו תגובה




Leave your השאירו שלך friendly ידידותי comment here. תגובה כאן.

If you have a computer help question, אם יש לך מחשב לעזור השאלה, click here to leave it on the forums לחץ כאן כדי להשאיר אותו על פורומים instead. במקום.

Note: Your comment may not show up immediately on the site. הערה: ההערה שלך לא תופיע מיד באתר.

Our Friends חברים שלנו
Getting Started התחלת העבודה


About How-To Geek אודות How-To Geek
What Is That Process? מה זה תהליך?
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. זכויות יוצרים © 2006-2009 HowToGeek.com. All Rights Reserved. כל הזכויות שמורות.