Archive for August 31st, 2005

Splitting up a database

I’m using a single MySQL database to handle all of my projects (this very blog, Élyste, Anticubed) and I realized its size was around 60mb. So I thought I should split it up in two different databases, since the tables that contain my Shortstat’s stats were around 58mb.

I don’t know if I’m right but I thought that if my projects data was in a leaner database, it could be accessed faster — because I recently experienced some slowness problems on the MySQL server.

What I did is, I exported all Shortstat’s tables to a single .sql file with phpMyAdmin and, after creating another databse in another host, I imported this 58mb .sql file in it with this command I found on a WordPress codex page:

mysql -h mysqlhostserver -u mysqlusername -p databasename < exported_file.sql

After deleting the old stats tables from my main database, its size was now 2mb, which is more convenient for daily backups than a 58mb one.

You might ask why I didn’t use the function in phpMyAdmin to import data instead of using MySQL command line? It’s because phpMyAdmin can’t handle file whose size is above 10mb.

Read more…


Sidebar