Importing SQL – 520 ci-error

If you are exporting a database from an older MySQL server such as 5.5.3 and are importing it to a newer MySQL server, you might receive 520 ci-error that appears such as:

#1273 – unknown collation ‘utf8mb4_unicode_520_ci’

There is an easy way to fix this error. Simply open your favorite notepad, and find:

utf8mb4_unicode_520_ci

and replace with:

utf8mb4_unicode_ci

That’s it!. Hope someone finds this simple guide useful.

Run OPTIMIZE TABLE to defragment tables for better performance

If you are noticing slugging performance wits your MySQL database, this simple tutorial is for you. This is particularly important for websites that have a large MySQL database. Please note that you must have root access and SSH access to proceed further. Log into your web hosting via SSH and follow below.

Run this command:

Code:

mysqlcheck -u root –auto-repair –optimize –all-databases

If you notice issues you can fix tables by issuing:

Code:

mysqlcheck -A -r -p

If everything has been fixed it is highly recommended to restart your MySQL server:

/etc/init.d/mysql restart

That is all, you should see increase in your MySQL queries and of course better performance.