Software Development Blog

phpMyImporter released

For many months, I wanted to be able to import backups of databases created by my other project, phpMyDumper, without using phpMyAdmin. The php configuration limits the filesize that phpMyAdmin can import. By default the filesize limit is 2 MB, which is potentially a problem if you are not able to change the php configuration, eg when using an external webhost.

I wrote this php class entirely from scratch my self and it does not have a filesize limit since it reads the file directly from the file directory. I also added progress information, so its easy to see when it is finish importing the sql file. It also supports compressed sql files created by phpMyDumper and phpMyAdmin and more importantly, it has support for UTF-8 connections to the MySQL datasbase.

Using the php class is straight forward if you have used phpMyDumper. Normally you will be using the php class from command line when you import one of your database backups. The example below shows how to use the phpMyImporter class. Have fun!
[file path=”phpmyimporter-1.00-example.php” tpl=”code”/]

Comments are closed.