#!/bin/bash


export sql_import_file_path="/root/wdd/database"
for sql_file in $(ls "$sql_import_file_path" | sort -n -k1.1,1.2); do
    echo "current file is ${sql_file}"
    # dev
#     /root/wdd/mysql/bin/mysql -uroot -pGwubc6CxRM -h192.168.35.178 -P33306 <"$sql_import_file_path/${sql_file}"
    # devflight
#     /root/wdd/mysql/bin/mysql -uroot -pGwubc6CxRM -h192.168.35.178 -P33307 <"$sql_import_file_path/${sql_file}"
    # devoperation
    # /root/wdd/mysql/bin/mysql -uroot -pGwubc6CxRM -h192.168.35.178 -P33308 <"$sql_import_file_path/${sql_file}"

    # chongqing san hua
#      /root/wdd/mysql/bin/mysql -uroot -pQzfXQhd3bQ -h36.133.115.164 -P53309  <"$sql_import_file_path/${sql_file}"

    # 云南二级平台
    sudo /root/wdd/mysql/bin/mysql -uroot -pQzfXQhd3bQ -h127.0.0.1 -P33306 <"$sql_import_file_path/${sql_file}"
    echo "------------------"
    echo ""
done