mysql非交互模式怎么创建数据库?
linux吧
全部回复
仅看楼主
level 8
pqy330
楼主
如题,我需要在一个shell脚本中创建数据库abc
shell脚本自动运行,无法接受用户的输入。
2014年11月21日 08点11分
1
level 12
烈焰小狮Fion
env mysql create schema abc?
import wx import os print("you are stupid, man!")
2014年11月21日 08点11分
2
level 13
锐思more
mysql -u user -p password << EOF
create database abc;
quit;
EOF
2014年11月21日 14点11分
3
锐思more
回复 锐思more : 咦,好像有什么地方不对,应该是 mysql -uuser -ppasswd << EOF换行 create database abc;换行 EOF
2014年11月22日 01点11分
level 13
abcfy2
mysql -u $user -p$password -e "create database $db_name"
2014年11月21日 14点11分
4
pqy330
好厉害啊
2014年11月22日 01点11分
abcfy2
回复 pqy330 :这些都在mysql的man手册有,你好好看就知道了
2014年11月22日 01点11分
level 14
刹那V永恒
postgreSQL大法好
2014年11月22日 01点11分
5
1