thamaraiselvam / mysql-import
使用mysqli将.sql文件导入数据库
1.1.0
2021-10-14 11:44 UTC
Requires
- php: >=5.6.0
- squizlabs/php_codesniffer: ^3.0@dev
Requires (Dev)
- phpunit/phpunit: >=7.0
- yoast/phpunit-polyfills: 1.x-dev
This package is auto-updated.
Last update: 2024-09-09 13:53:31 UTC
README
使用MySQL导入轻松导入MySQL数据库备份文件
开发
运行
$ git clone https://github.com/thamaraiselvam/mysql-import.git
$ cd mysql-import
$ composer install
这将为您设置库依赖。
要运行测试,运行
$ composer phpunit
为确保您的代码遵循编码风格,运行
$ composer phpcs
安装
使用composer,在终端中键入以下内容以包含存储库
composer require thamaraiselvam/mysql-import
用法
包含composer自动加载器,导入Import命名空间。
<?php
require('vendor/autoload.php');
use Thamaraiselvam\MysqlImport\Import;
$filename = 'database.sql';
$username = 'root';
$password = '';
$database = 'sampleproject';
$host = 'localhost';
new Import($filename, $username, $password, $database, $host);