mirror of
https://github.com/dunwu/linux-tutorial.git
synced 2024-04-15 19:55:24 +08:00
14 lines
202 B
Bash
14 lines
202 B
Bash
#!/bin/bash
|
|
|
|
#连接数据库
|
|
mysql=`which mysql
|
|
`
|
|
#发送单个命令
|
|
$mysql emwjs -u test -e "show databases;"
|
|
|
|
#发送多个命令
|
|
$mysql emwjs -u test <<EOF
|
|
show tables;
|
|
select * from em_admin;
|
|
EOF
|