How to save base64 to blob of MySQL?

Is there a way to save default MySQL connection parameters in a configuration file?

  • Is there a way to save the connection params(like host, port, username, password, db) to the mysql servers I frequently access as shortcuts? I am looking for something similar to [ssh config][1] for mysql from terminal in ubuntu. preferably with ssh tunneling support as well.   [1]: http://linux.die.net/man/5/ssh_config

  • Answer:

    You can tell mysql command line client to read additional groups with a given suffix in addition to the default [client] and [mysql] groups. See: http://dev.mysql.com/doc/refman/5.5/en/option-files.html#option_general_defaults-group-suffix For example: Add the following group to your users ~/.my.cnf or the global /etc/my.cnf [mysql_55]  (or [client_55]) user=<user> password=<password> database=<database> host=<host> port=<port> # or # socket=<socket> Add as many or as few command options as you like. $ alias mysql55="mysql --defaults-group-suffix=_55" Then from the command line just call "mysql55" to login with the options stored in the [mysql_55] or [client_55] groups. To confirm what groups the alias is reading you can check the --help command. $ mysql55 --help | grep groups The following groups are read: mysql client mysql_55 client_55 Don't forget to add the aliases to your ~/.bashrc !

Matthew Montgomery at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.