Results 1 to 5 of 5

Thread: MySQL copy table (or terminal options)

  1. #1

    MySQL copy table (or terminal options)

    Hello all... I am trying to copy the structure of a table (not the data, just the structure and column names) and make about 20 copies of it under different table names. I know that I should be able to do this with mysqldump, but unfortunately, I am a syntax idiot. I read the man pages for it, and I can't (and never have on my Linux systems) the syntax needed.

    I know how to use the "-x" options (i.e. -c, or -d, etc.) but I have never successfully used the "--x" options (with the two hyphens). I simply have no idea how to insert them into the command to get it to work, whether it be in mysql, or my terminal.

    It is a simple case of my ignorance of a basic principle keeping me from being more productive.

    I know that as far as the terminal, this is basic knowledge, but I lack it and any help would be greatly appreciated, as it would save me hours of data input. Thanks guys.



    Asus A8V Deluxe Mobo
    AMD Athlon64 X2 4400 -939
    2GB Crucial DDR3200 Dual-Channel
    ATi AiW 9800 Pro 128DDR
    Audigy2 ZS
    Sony DRU-810 DVD+RW DL
    3 x Maxtor MaxLine SATA 160Gb 16Mb Cache
    1 x Maxtor MaxLine SATA 300Gb 16Mb Cache
    1 x Maxtor MaxLine SATA 120Gb 16Mb Cache

  2. #2

    Re:MySQL copy table (or terminal options)

    have you tried using a frontend, such as phpMyAdmin. Its alot easier than remembering the synatx
    On the other hand, if you *want* to /*have* to use the termonal, sorry.. i can't help you
    whatdoyougetwhenyoumultiplysixbynine??

  3. #3

    Re:MySQL copy table (or terminal options)

    I downloaded SQLyog last night and that seems to work pretty good for me to copy the tables, but I was also asking this because when I am doing something in the terminal (not SQL related), it would be handy to know how to do the options. For example, (this command is completely made up) you can have ls "-c" and that is easy enough to understand, as you just input "ls -c". But let's say you read a man page, and maybe you have other options you can use like "--help" or "--joeblow". When the 'two-hyphen' options come into play, for some reason, I can never get the syntax right and it gets really ugly. I don't know if they are supposed to go in a certain order or...?
    Asus A8V Deluxe Mobo
    AMD Athlon64 X2 4400 -939
    2GB Crucial DDR3200 Dual-Channel
    ATi AiW 9800 Pro 128DDR
    Audigy2 ZS
    Sony DRU-810 DVD+RW DL
    3 x Maxtor MaxLine SATA 160Gb 16Mb Cache
    1 x Maxtor MaxLine SATA 300Gb 16Mb Cache
    1 x Maxtor MaxLine SATA 120Gb 16Mb Cache

  4. #4
    Senior Member
    Join Date
    Nov 2001
    Posts
    304

    Re:MySQL copy table (or terminal options)

    Using the following snippit from an online man page:

    Code:
    NAME
    
         ifconfig - configure network interface parameters
    
    
    SYNOPSIS
    
         ifconfig [-L] [-m] interface [create] [address_family]
          [address[/prefixlength] [dest_address]] [parameters]
         ifconfig interface destroy
         ifconfig -a [-L] [-d] [-m] [-u] [address_family]
         ifconfig -l [-d] [-u] [address_family]
         ifconfig [-L] [-d] [-m] [-u]
    when you see something like this in a man page, what it says is this:

    the command (in this case ifconfig) is followed by one or more flags, then an interface, then optionally, directives such as "create" "address_family" etc...

    This man page doesn't show "--" flags, but generally the order for any flag doesn't matter as long as you put the flag where they list the optional flags in the page. Now... for "--" flags:

    some programs include "long flag names" which generally begin with "--" and often have a "-" equivalent. For instance, some have this:

    -h, --help

    in their description of what the flags are. This means that -h is equivalent to --help... and will generate the same output. Sometimes you'll see something like "-f, --file=<somefile>"

    This usually means you can do something like this:
    -f filename
    or
    --file=filename

    that's about all there is to the flags... it seems confusing at first, but that's the gist. If I confused you more, please let me know and I'll try to give a better example.

  5. #5

    Re:MySQL copy table (or terminal options)

    Nope, actually you clarified it well. What I was always trying to do (dealt with "--" flags with no "-" equivalent) was something like this:

    command -c --whatever filename blahblah (I put all of the flags right after the command)

    instead of:

    command -c filename --whatever blahblah

    I should have known that the terminal would interpret the space between filename and blahblah weirdly, and that should have been my first clue that the order was wrong.
    Thanks for the help. You just made my future command line stints alot easier.
    Asus A8V Deluxe Mobo
    AMD Athlon64 X2 4400 -939
    2GB Crucial DDR3200 Dual-Channel
    ATi AiW 9800 Pro 128DDR
    Audigy2 ZS
    Sony DRU-810 DVD+RW DL
    3 x Maxtor MaxLine SATA 160Gb 16Mb Cache
    1 x Maxtor MaxLine SATA 300Gb 16Mb Cache
    1 x Maxtor MaxLine SATA 120Gb 16Mb Cache

Similar Threads

  1. Problem starting mysql conflicts with the RPM "mysql-5.0.27-1.fc6"
    By kamakshiganesh in forum Redhat / Fedora
    Replies: 2
    Last Post: 10-26-2007, 04:35 AM
  2. MySQL worm for Windows halted
    By genesis in forum Windows - General Topics
    Replies: 0
    Last Post: 01-28-2005, 10:53 PM
  3. Setting up a Routing table in ClarkConnect 2.2 (RedHat 9)
    By wetmetalthong in forum Linux - Hardware, Networking & Security
    Replies: 0
    Last Post: 01-19-2005, 01:40 AM
  4. Data in MySQL table in several array's
    By xin in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 07-22-2002, 08:13 PM
  5. mysql installation instructions & permissions
    By elovkoff in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 02-06-2002, 11:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •