Ubuntu mysql client emma Chinese garbled problem solution emma is installed with apt-get by default, emma does not support Chinese, the configuration file or directly modify the emma program source file (python ). Apt-get install emmasudo apt-get install emma www.2cto.com. If you have installed emma and run emma, the program will be created ~ /. Emma/emmarc file to save the configuration. Therefore, you can change the configuration file or directly modify the python source file of emma as follows. Vim ~ /. Emma/emmarc find db_encoding = latin1 and change it to db_encoding = utf8 to run emma again. At this time, it is still garbled. Add this SQL statement before executing all the SQL statements, after set names utf8 is executed by pressing ctrl + enter, OK! Www.2cto.com, but it is not very laborious to directly modify the emma source file every time a new user needs to modify the configuration file and add the statement before executing the new SQL statement, the newly created emmrc configuration file is utf8, and when the database is selected, the "set names utf8" statement is automatically executed. Install emma in apt-get of ubuntu under the/usr/share/emma directory. Cd/usr/share/emma/emmalib sudo vim _ init _. py find "db_encoding": "latin1" to "db_encoding": "utf8" Save and quit. In the future, the newly created configuration file will be decoded by utf8 by default. I want to execute the "set names utf8" statement after the data is connected, so where does the function www.2cto.com sudo vim/usr/share/emma/emmalib/mysql_host.py jump to the _ use_db (self, name, do_query = True) Function Around 155 rows, change to def _ use_db (self, name, do_query = True): if self. current_db and name = self. current_db.name: return if do_query: self. query ("use '% S'" % name, False) self. query ("set names utf8", False) try: self. current_db = self. databases [nam E] couldn t KeyError: print "Warning: used an unknown database % r! Please refresh host! \ N % s "% (name," ". join (traceback. format_stack ()))