Categories
Tips & Tricks

Fixed: Corrupt SQL file contains unicode characters

I happened to have my backup sql file which contains Unicode characters broken. This happened when I had just bought a new version of Mamp Pro to install in my Mac. It comes with the latest PHP and a lot of exiting features!

I then re-installed my database of one project that contains Unicode characters. Unfortunately, it shows strange characters like below:

It’s a double converted character. To fix it, simply:

  1. Convert back to latin1
  2. Convert to binary
  3. Convert to utf8

So, go to the SQL tab of the phpMyAdmin, and run the following command:

alter table table_name modify field_name VARCHAR(2000) character set latin1;
alter table table_name modify field_name blob;
alter table table_name modify field_name VARCHAR(2000) character set utf8;

Then the unicode character will be back.

Categories
Vesta

MySQL Service is not Loaded on Ubuntu 14.04

There is a rare cases happen in one of our client servers which MySQL service could not be loaded based on a number of reasons. We’ve eventually found the solution by going to edit the /etc/mysql/my.cnf and add the following configuration:

open_files_limit=65535

After that restart mysql by running the following command:

sudo /etc/init.d/mysql start

Categories
Vultr

Check if Apache2 and MySQL Services are Running on Ubuntu

To check if Apache2 service is running, simply run the following command:

sudo service apache2 status

To check if MySQL service is running, simply run the following command:

sudo service mysql status

For CentOS or Fedora:

To restart the service: $ sudo systemctl restart httpd

And

To check the service status: $sudo systemctl status httpd