文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>shell执行mysql

shell执行mysql

时间:2010-04-12  来源:ubuntuer

shell中如何直接执行mysql语句那....

1.直接管道过去
echo "show databases" | mysql -uroot -p'123456'
Database
information_schema
mysql
sakila
test

2.从文件
[root@kenthy sakila-db]# cat file
show databases;
[root@kenthy sakila-db]# mysql -uroot -p'123456' < file
Database
information_schema
mysql
sakila
test


3.块
[root@kenthy sakila-db]# mysql -uroot -p'123456' << SQL
> show databases;
> SQL
Database
information_schema
mysql
sakila
test

相关阅读 更多 +
排行榜 更多 +
宝宝欢乐农场

宝宝欢乐农场

休闲益智 下载
我的世界外进神器

我的世界外进神器

游戏工具 下载
飞虎队模拟器2

飞虎队模拟器2

飞行射击 下载