编写shell脚本导 cd /where_is_sql for sql in $(echo *.sql) do mysql -h localhost -u root -p mydb < $sql done