Metrics
0
Watch 80 Star 201 Fork 90

七觞酒 / yiicmsPHP

Sign up for free
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
yiicms 企业站 http://demo2.yiiphp.net spread retract

http://demo2.zbeijing.com.cn

  • PHP 88.4%
  • JavaScript 7.1%
  • CSS 3.9%
  • Batchfile 0.2%
  • Hack 0.2%
  • Other 0.2%
Clone or download
importsql 753 Bytes
Copy Edit Web IDE Raw Blame History
七觞酒 authored 2017-12-02 16:35 . 添加sql 导入脚本
#!/bin/bash
if [ ! -f "yiicms.sql" ]; then
echo '当前目录下没有找到yiicms.sql文件'
exit 1
fi
read -p "dbName(默认yiicms):" dbName
read -p "user(默认root):" user
read -p "password(默认123456):" password
read -p "host(默认127.0.0.1):" host
if [ ! -n "$dbName" ]; then
dbName='yiicms'
fi
if [ ! -n "$user" ]; then
user='root'
fi
if [ ! -n "$password" ]; then
password='123456'
fi
if [ ! -n "$host" ]; then
host='127.0.0.1'
fi
echo "dbName:"$dbName,"user:"$user, "password:"$password, "host:"$host
MYSQL=`which mysql`
$MYSQL --user="$user" --password="$password" --host="$host" <<EOF
CREATE DATABASE /*!32312 IF NOT EXISTS*/ $dbName /*!40100 DEFAULT CHARACTER SET utf8 */;
use $dbName;
source yiicms.sql;
EOF

Comment ( 0 )

You need to Sign in for post a comment

Help Search

183227_9af5e6a8_1826025 111910_4d91f001_1826025