开发者

mysql connection profiles configuration file

Is there a way to save the connection params(like host, port, username, password, db) to the开发者_Go百科 mysql servers I frequently access as shortcuts?

I am looking for something similar to ssh config for mysql from terminal in ubuntu. preferably with ssh tunneling support as well.


You could use the --defaults-file option combined with an shell alias, for example:

% cat db01
[mysql]
user=root
password=<your_pwd>
host=<your_host>


% alias my_db01='mysql --defaults-file=db01'

% my_db01
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 41
Server version: 5.1.54-1ubuntu4 (Ubuntu)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

So you can create different files with different settings.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜