I have configured multiple databases in my.cnf file and trying to use them via command line mysql.
My config looks like this:
[client]
host=abaabs
user=asdads
password=vxcvx
database=zdxew
[client_read]
host=12312
user=34534
password=546456
database=6786786
And when i say mysql on command line i get by default client config as the default database. How do I select the second database on mysql cmd?
On command line $ mysql --defaults-group-suffix=_read
for the client_read database.
You may wish to make an alias for a given database using something like:
$ alias myreaddb "mysql --defaults-group-suffix=_read"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With