shell中登录mysql并执行操作

好吧,这其实是mysql的知识点。

写一个shell,要求登录到mysql并执行某些语句,这样写:

mysql -h$host -P$port -u$user -p$psw -e select * from table

嗯,就是这个-e。

猜你喜欢

转载自fandayrockworld.iteye.com/blog/1337342