mysqleditline

Let MySQL client command line accept characters with accents as input


I don't know how to enable my MySQL client to accept letters with accents as input on the command line on Ubuntu. These chars are not echoed on the console nor accepted as input. As far as I remember, in previous versions of mysql, I solved this problem by launching the client with command mysql --default-character-set=utf8 but this doesn't work with mysql Ver 14.14 Distrib 5.7.25, for Linux (x86_64) using EditLine wrapper on Ubuntu 18.04.

What does work is echo 'SELECT "é" AS letter' | mysql <dbname>, which gives the correct output.

I suspect the EditLine wrapper to be guilty of this behaviour, but I don't know how to get rid of this unwanted feature.


Solution

  • I discovered today that I inherited in my current bash an alias from the setup of a previous installation:

    alias mysql='mysql --default-character-set=utf8'
    

    Since I removed that alias (with unalias mysql), the misbehaviour disappeared.