Ask a Question related to MySQL, Design and Development.
-
ryankbrown@gmail.com #1
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
-
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.... -
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... -
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... -
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... -
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... -
Bill Karwin #2
Re: Outputting name of db's to text file
[email]ryankbrown@gmail.com[/email] wrote:
"mysqlshow > textfile" doesn't work for you?> I am looking for a way to output the results of the mysqlshow command
> to a text file.
Regards,
Bill K.
Bill Karwin Guest
-
ryankbrown@gmail.com #3
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
-
Bill Karwin #4
Re: Outputting name of db's to text file
[email]ryankbrown@gmail.com[/email] wrote:
Aha. That was not part of your original question.> That works great except for the fact that I cannot have the extra
> characters ("---+", etc.) that it creates.
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
-
Radoulov, Dimitre #5
Re: Outputting name of db's to text file
> That works great except for the fact that I cannot have the extra
mysqlshow | tr -d "|+-" > textfile> characters ("---+", etc.) that it creates.
Regards
Dimitre
Radoulov, Dimitre Guest
-
ryankbrown@gmail.com #6
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
-
Bill Karwin #7
Re: Outputting name of db's to text file
[email]ryankbrown@gmail.com[/email] wrote:
There are other "show" commands you can use with this method.> This seems to work great however, will this work for databases or just
> tables?
See [url]http://dev.mysql.com/doc/refman/5.0/en/show.html[/url] for a list.
Regards,
Bill K.
Bill Karwin Guest
-
ryankbrown@gmail.com #8
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



Reply With Quote

