Professional Web Applications Themes

Outputting name of db's to text file - MySQL

I am looking for a way to output the results of the mysqlshow command to a text file. I can probably manage this with Perl but was wondering if there was an easier way to achieve it. Does anybody know of any built-in functions that will do this or any free tools or code examples? Thank you in advance. rbr...

  1. #1

    Default Outputting name of db's to text file

    I am looking for a way to output the results of the mysqlshow command
    to a text file. I can probably manage this with Perl but was wondering
    if there was an easier way to achieve it. Does anybody know of any
    built-in functions that will do this or any free tools or code
    examples?

    Thank you in advance.

    rbr

    ryankbrown@gmail.com Guest

  2. #2

    Default Re: Outputting name of db's to text file

    [email]ryankbrown[/email] wrote:
    > I am looking for a way to output the results of the mysqlshow command
    > to a text file.
    "mysqlshow > textfile" doesn't work for you?

    Regards,
    Bill K.
    Bill Karwin Guest

  3. #3

    Default Re: Outputting name of db's to text file

    That works great except for the fact that I cannot have the extra
    characters ("---+", etc.) that it creates.

    Thank you for the suggestion.

    rbr

    Bill Karwin wrote:
    > [email]ryankbrown[/email] wrote:
    > > I am looking for a way to output the results of the mysqlshow command
    > > to a text file.
    >
    > "mysqlshow > textfile" doesn't work for you?
    >
    > Regards,
    > Bill K.
    ryankbrown@gmail.com Guest

  4. #4

    Default Re: Outputting name of db's to text file

    [email]ryankbrown[/email] wrote:
    > That works great except for the fact that I cannot have the extra
    > characters ("---+", etc.) that it creates.
    Aha. That was not part of your original question.

    I would do this:

    mysql -uuser -ppassword --batch -e "show tables" database > textfile

    The "--batch" (or -B) option suppresses all the pipes and such, but
    unfortunately it is not available in the mysqlshow command.

    Regards,
    Bill K.
    Bill Karwin Guest

  5. #5

    Default Re: Outputting name of db's to text file

    > That works great except for the fact that I cannot have the extra
    > characters ("---+", etc.) that it creates.
    mysqlshow | tr -d "|+-" > textfile


    Regards
    Dimitre




    Radoulov, Dimitre Guest

  6. #6

    Default Re: Outputting name of db's to text file

    Sorry I didn't mention that earlier.

    This seems to work great however, will this work for databases or just
    tables?

    Thanks again,

    Ryan

    Bill Karwin wrote:
    > [email]ryankbrown[/email] wrote:
    > > That works great except for the fact that I cannot have the extra
    > > characters ("---+", etc.) that it creates.
    >
    > Aha. That was not part of your original question.
    >
    > I would do this:
    >
    > mysql -uuser -ppassword --batch -e "show tables" database > textfile
    >
    > The "--batch" (or -B) option suppresses all the pipes and such, but
    > unfortunately it is not available in the mysqlshow command.
    >
    > Regards,
    > Bill K.
    ryankbrown@gmail.com Guest

  7. #7

    Default Re: Outputting name of db's to text file

    [email]ryankbrown[/email] wrote:
    > This seems to work great however, will this work for databases or just
    > tables?
    There are other "show" commands you can use with this method.

    See [url]http://dev.mysql.com/doc/refman/5.0/en/show.html[/url] for a list.

    Regards,
    Bill K.
    Bill Karwin Guest

  8. #8

    Default Re: Outputting name of db's to text file

    mysql -uusername -ppassword --batch -e "show dat
    abases" > dbs.txt

    Works like a charm.

    Thank you,

    rbr


    Bill Karwin wrote:
    > [email]ryankbrown[/email] wrote:
    > > This seems to work great however, will this work for databases or just
    > > tables?
    >
    > There are other "show" commands you can use with this method.
    >
    > See [url]http://dev.mysql.com/doc/refman/5.0/en/show.html[/url] for a list.
    >
    > Regards,
    > Bill K.
    ryankbrown@gmail.com Guest

Similar Threads

  1. Outputting a CFC Component
    By murpg in forum Coldfusion - Advanced Techniques
    Replies: 5
    Last Post: June 9th, 12:04 PM
  2. text field including text from a text file *.txt
    By Bernd Bach in forum Macromedia Flash
    Replies: 0
    Last Post: April 13th, 09:37 AM
  3. Headers, outputting a file ..
    By Wouter Van Vliet in forum PHP Development
    Replies: 2
    Last Post: September 17th, 02:02 PM
  4. [PHP] XX outputting X signs
    By George Pitcher in forum PHP Development
    Replies: 1
    Last Post: July 22nd, 03:08 PM
  5. outputting XML from PHP
    By Aarron in forum PHP Development
    Replies: 1
    Last Post: July 21st, 03:08 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139