繁体   English   中英

mysql连接配置文件配置文件

[英]mysql connection profiles configuration file

有没有一种方法可以将连接参数(例如主机,端口,用户名,密码,数据库)保存到我经常以快捷方式访问的mysql服务器上?

我正在从ubuntu的终端中寻找类似于mysql的ssh config的东西。 最好还带有ssh隧道支持。

您可以将--defaults-file选项与外壳程序别名结合使用,例如:

% 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>

因此,您可以使用不同的设置创建不同的文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM