Importing a MySQL DB into WAMP

If you are like me and other Windows users, you most likely use WAMP or XAMPP as a PHP localhost environment stack. And in most cases, you use the MySQL service along with phpMyAdmin. For the most part phpMyAdmin handles all the database management tasks you need as well as a pretty great import and export feature. However, there are times when your DB dump is far too large for phpMyAdmin to handle, and twiddling with php.ini settings doesn't help fix it -- but there is a solution!

The MySQL services comes installed with a MySQL console which you can use to import the SQL file. After you turn WAMP on, click on the system tray icon, navigate to the MySQL folder and open the MySQL console. This should open a command prompt that asks for your password (usually empty if you use the default install settings). To import simply run the following commands (you can type \h to view more all the commands).

use databaseName;
\. C:\path\to\sql\dump.sql

And that's it! Be sure to have a raw SQL dump as the import won't work on gzipped files.

Databasic v2.0 has arrived!

I am proud to present the new Databasic, version 2.0! Since I added quite a few new methods and functionality, rewrote and optimized most of the code, I felt it would be good to deem this version 2.0 instead of 1.11. The biggest new features in this version are support for multiple databases, using the create() method to create a database table, and the addition of many MySQL statement methods. Some of these new methods include drop(), truncate(), describe(), create() and optimize(). On top of all these additions, I have cleaned the code and fixed any bugs that were existent.

Note before upgrading! The new 2.0 version is not necessarily backwards compatible, the new system removes the constants that are used for the connection info, and instead uses a new method called store() that can store multiple connections. Finally the select() method has been changed, the arguments $limit and $offset have been removed and are now part of the $options array.

You may now subscribe to my newsletter, that will be send out emails when a script has a new version available.

Download Databasic v2.0
View the complete change log

Databasic v1.10.3 Released

It seems the most recent version of my Databasic class had a few problems in it. I left some code in there (echos and comments) that was used while I was testing, and I forgot to revert it. I want to thank Tanax for sending me an email and pointing it out. To everyone else, please download the latest version (1.10.3) and be sure to email me if you find any problems.

Download Databasic v1.10.3
View the complete change log

Databasic v1.10.2 Released

I have just released a new version of my MySQL database class, Databasic. This new version fixes a few issues with binds, MySQL functions and little bugs here and there. I have also added an "takes x seconds to execute the query" to every query in debug mode, no idea why I didn't add it before!

Update! There was a small bug in version 1.10.1 concerning the execute() method. I just patched it to 1.10.2, enjoy!

Download Databasic v1.10.2
View the complete change log