In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Today, I will talk to you about how to understand mysql graphics client Emma, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
If you use mysql's graphics client, I think Emma is a good one.
It's better than mysql's own Mysql Query Browser, and the most unbearable thing is that Mysql Query Browser will crash in Ubuntu 11.10.
In comparison, emma is good, but if emma is installed with apt-get by default, emma does not support Chinese, which requires you to modify the configuration file or directly modify the emma program source file (emma is written in python).
Apt-get install emma
Sudo apt-get install emma
If you have installed and run emma, the program will create a ~ / .emma / emmarc file to save some of your own configurations. So you can change the configuration file here, or modify emma's python source file directly as below.
Vim / .emma/emmarc
Find www.2cto.com.
Db_encoding=latin1
Change to
Db_encoding=utf8
Then, rerun emma, and find that it is still garbled. Don't worry, add this sql statement before executing all the sql statements.
Set names utf8
Press ctrl+enter to execute, and then see if it is already ok. Chinese is displayed normally. (there is also a premise that yours are all utf8 coded.)
OK, but isn't it a lot of effort for new users to change their configuration files every time and add this statement before executing the new sql? And I am very lazy, and most of my databases are utf8, so modify the source file of emma directly to realize that the newly created emmrc configuration file is utf8, and automatically execute the "set names utf8" statement when selecting the database.
The apt-get installation emma for Ubuntu is under the / usr/share/emma directory.
Cd / usr/share/emma/emmalib
Sudo vim _ _ init__.py
find
"db_encoding": "latin1"
Change to
"db_encoding": "utf8"
Save exit. The newly created configuration file will be decoded by utf8 by default. I want to execute the "set names utf8" statement after connecting the data, so www.2cto.com
Sudo vim / usr/share/emma/emmalib/_host.py
Jump to the _ use_db (self, name, do_query=True) function around line 155, and change it 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]
Except KeyError:
Print "Warning: used an unknown database% r! please refresh host!\ n% s"% (name, "" .join (traceback.format_stack ()
Look at the change, anyway, change to the above look, pay attention to the space, because the python is to use the space as the syntax of the sentence.
In fact, it is just an addition.
Self.query ("set names utf8", False)
At this point, you will be thoroughly ok.
After reading the above, do you have any further understanding of how to understand the mysql graphics client Emma? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.