Outputting name of db's to text file

Ask a Question related to MySQL, Design and Development.

  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. Similar Questions and Discussions

    1. Jumping DB's Easily?
      I am setting up a Central Database to hold all the configurations of each database. Each database will be idential in tables and stored procedures....
    2. Showing records from two db's in one portal?
      Depends on the eventual mechanism you intend for analysing your data. If it means combining similar types of data into sets and sorting for...
    3. Headers, outputting a file ..
      Hi All, I feel almost ashamed for having to ask this question. Mostlly because I know it's been asked so many tmes but I just don't seem to be...
    4. Same field in two DB's
      I am using Access 2000 I have two different databases; One for material disposition (DB-1) and another one for Vendor returns (DB- 2). In the...
    5. 2 Instances vs 2 DB's in SQL 2K
      I have to agree with Tom. The production environment should be separated from the dev and test environments as much as possible, preferably on it's...
  3. #2

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

    [email]ryankbrown@gmail.com[/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

  4. #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@gmail.com[/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

  5. #4

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

    [email]ryankbrown@gmail.com[/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

  6. #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

  7. #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@gmail.com[/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

  8. #7

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

    [email]ryankbrown@gmail.com[/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

  9. #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@gmail.com[/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

Posting Permissions

  • You may not post new threads
  • You may 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