V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
udumbara
V2EX  ›  MySQL

请教一个 mycli 的问题

  •  
  •   udumbara · 2017-08-02 09:56:50 +08:00 · 3001 次点击
    这是一个创建于 2452 天前的主题,其中的信息可能已经有所发展或是发生改变。

    请问下使用 mycli 的各位,有办法将多个数据库连接信息保存在某个文件,然后每次连接的时候, 直接输入

    mycli mydatabase 
    

    的方式连接指定数据库么

    我现在知道的是在.my.cnf 的 client 里添加

    user = ××
    password = ××
    host = ××
    database = ××
    port = ××
    

    这种方式,作为默认连接数据库 但是存在多个不同服务器的库的时候就不方便了

    3 条回复    2019-09-20 17:09:59 +08:00
    RoundCat
        1
    RoundCat  
       2017-08-02 10:26:59 +08:00   ❤️ 1
    Legendzhan
        3
    Legendzhan  
       2019-09-20 17:09:59 +08:00
    alias 了解一下
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1006 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 19:02 · PVG 03:02 · LAX 12:02 · JFK 15:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.