'MySQL SET NAMES Query

Everytime when I connect to MySQL I run the following query:

SET NAMES 'utf8'

Can I safely remove this query when I set it in the MySQL Conf (my.conf)?

I found this with google: http://blog.oneiroi.co.uk/mysql/mysql-forcing-utf-8-compliance-for-all-connections/

Is this enough or am I missing something? Or is there a better method?



Solution 1:[1]

Or is there a better method?

yes.

$mysqli->set_charset('utf8');

is the only reliable method.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Your Common Sense