Ubuntu mysql client emma Chinese garbled Problem Solution

Source: Internet
Author: User


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 ()))

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.