bjudson
bjudson

Reputation: 4083

MySQL cmd line characters

I'm trying to remove stray characters that ended up in a MySQL table. So to remove _, I just did this:

UPDATE table SET field = REPLACE(field, '_', '');

Now I'm trying to do the same thing with ¬, but I can't place this character in the command line (bash). Any tips for encoding / escaping this character?

Upvotes: 1

Views: 255

Answers (1)

linuts
linuts

Reputation: 6748

It depends on your locale, but if you're using UTF-8 then this works for me:

echo -e '\0302\0254'

Update:

Does this do it for you?

mysql> select x'c2ac';
+---------+
| x'c2ac' |
+---------+
| ¬      |
+---------+
1 row in set (0.00 sec)

Upvotes: 1

Related Questions