Home > php > Cons of Storing Files In Mysql

Cons of Storing Files In Mysql

Actually this is a terrible idea in real world scenario and the reason is:

if you need to recover your database and/or copy to another server from a backup sql file, you can not import the sql file into mysql.

Tested with different mysql and mariadb versions on different linux platforms.

Every time i try to import the sql file mysql crashes. Only way to recover your database is removing table data which includes files (blob column) from your sql file.

Of course you have another option to backup and recover your data. Copy actual database/tables (/var/lib/mysql/) to the new server and run:

[root@mk ~]# mysql_upgrade
Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: