通过 PHP 导入 MySQL 数据库

<?php exec("mysql -uusername -ppassword -e \"use database; source sql_file_path\""); ?>

Over!

3 thoughts on “通过 PHP 导入 MySQL 数据库”

  1. mysql databasename < sql_file_path.sql –default-character-set=utf8

    注意密码的转义符号,O(∩_∩)O~,今天非常谢谢,新年快乐啊~

Leave a Reply

Your email address will not be published. Required fields are marked *