78 Unstar Star 225 Fork 95

七觞酒 / yiicms

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
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 )

Sign in for post a comment

PHP
1
https://git.oschina.net/templi/yiicms.git
git@git.oschina.net:templi/yiicms.git
templi
yiicms
yiicms
master

Search

132457 8cb2edc1 1899542 131848 70c8d3a4 1899542