如何使用Shell脚本访问mysql数据库? [英] How to access mysql database using shell script?

查看:49
本文介绍了如何使用Shell脚本访问mysql数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以使用Shell脚本访问MySQL数据库?想在多个表上进行一些选择和插入吗?

Is there a way I can access MySQL database using shell script? want to do some selects and some inserts on multiple tables?

如果您能提供一些示例代码(这对我来说是脚本新手),那就太好了.

It will be great if you can give some sample code as I am new to scripting.

推荐答案

此链接似乎包含您想要的信息.

This link seems to have the information you want.

http://www.cyberciti.biz/faq/using-mysql-in-shell脚本/

mysql -u user -p dbnane

这篇关于如何使用Shell脚本访问mysql数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆