thamaraiselvam / mysql-import
Import .sql file into a database using mysqli
Installs: 35 795
Dependents: 1
Suggesters: 0
Security: 0
Stars: 39
Watchers: 6
Forks: 21
Open Issues: 0
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-10-09 13:58:44 UTC
README
Import MySQL database backup files easily with MySQL Import
Development
Run:
$ git clone https://github.com/thamaraiselvam/mysql-import.git
$ cd mysql-import
$ composer install
This will setup the library dependencies for you.
To run tests, run
$ composer phpunit
To ensure your code is following the coding style, run
$ composer phpcs
Install
Using composer include the repository by typing the following into a terminal
composer require thamaraiselvam/mysql-import
Usage
Include the composer autoloader, import the Import namespace.
<?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);