Fun Table Names

Turns out you can create fun tables names in MySQL:

mysql> create table ☃ (a int not null);
Query OK, 0 rows affected (0.16 sec)

mysql> drop table ☃ ;
Query OK, 0 rows affected (0.10 sec)

In the original post, Jay Pipes ran into an issue where he could do that on Drizzle and not on MySQL, but it turned out that he has not “set names UTF8” in the client.

I just put that in the my.cnf file as follows so I don’t have to think about it:

# Set the names to utf8 when a client connects
init_connect = ‘SET NAMES utf8’

I also set:

# Set the default character set to utf8
default_character_set = utf8

# Set the server character set
character_set_server = utf8

So basically I have utf8 from one end to the other, which is the way to go these days I think just to get any encoding issues out of the way.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

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: