Ubuntu MySQL Emma Chinese garbled problem solved

Source: Internet
Author: User

Ubuntu MySQL Emma Chinese garbled problem resolution Emma is installed with Apt-get by default, Emma is not supported in Chinese, configuration files or directly modify the Emma program source files (Python). Apt-get installed Emmasudo apt-get install Emma Ubuntu Apt-get installation Emma is under the/usr/share/emma directory. Cd/usr/share/emma/emmalib sudo vim __init__.py find "db_encoding": "Latin1" changed to "db_encoding": "UTF8" to save exit. If you've already installed and run Emma, the program will create a ~/.emma/emmarc file and save the configuration. So you can change the configuration file here, or directly modify Emma's Python source file as below. Vim ~/.emma/emmarc Find db_encoding=latin1 change to Db_encoding=utf8 then sudo vim/usr/share/emma/emmalib/mysql_host.py jump to 155 rows or so  _use_db (self, name, do_query=true) function, change to the following 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[name] Exce PT Keyerror:print "warning:used an unknown database%r! Please refresh host!/n%s "% (name," "". Join (Traceback.format_stack ()))




Ubuntu MySQL Emma Chinese garbled problem solved

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.