MySQL encoding problems under linux

2011-10-09  来源:本站原创  分类:Database  人气:51 

Reference: http://blog.sina.com.cn/s/blog_4f925fc30100o0rx.html
I. Table of Contents Introduction

1. Database directories 

  /var/lib/mysql/, MySQL here corresponds to windows MySQL under date Folder 

  2. Profile 

  /usr/share/mysql(mysql.server Command and configuration file )

  3. Related commands 

  /usr/bin(mysqladmin mysqldump Commands such as )

  4. Startup scripts
     /etc/init.d/mysql start

II. Generate Files

1)find / -iname *.cnf -print
2)cp /usr/share/mysql/my-medium.cnf /etc/my.cnf

III. Coding

Under Linux, modify mysql Profile my.cnf(vi /etc/my.cnf) Default file location/etc/my.cnf file 

 Find the client configuration [client]  Below add
default-character-set=utf8  The default character set is utf8
 Then locate [mysqld]  Add
    default-character-set=utf8  The default character set is utf8
     Or 

character-set-server=utf8

[ Note ]:default-character-set Character-set-server both written the recognition MySQL Different versions may be. 5.5 Next default-character-set=UTF8 reports an error .Starting MySQL..The server quit without updating PID file 

init_connect='SET NAMES utf8' ( Set connection used when MySQL database utf8 Encoding, so that mysql Run database to UTF8 )

Modification is completed, restart the mysql ( service mysql restart  Or perform :sudo /etc/init.d/mysql stop  And then sudo /etc/init.d/mysql start)  , The query show variables like 'character%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
相关文章
  • MySQL encoding problems under linux 2011-10-09

    Reference: http://blog.sina.com.cn/s/blog_4f925fc30100o0rx.html I. Table of Contents Introduction 1. Database directories /var/lib/mysql/, MySQL here corresponds to windows MySQL under date Folder 2. Profile /usr/share/mysql(mysql.server Command and

  • How to modify MySQL encoding problems under Linux 2011-10-26

    After the default login mysql show variables like '% character%', there mysql "show variables like '% character%'; +--------------------------+---------------------- ------+ | Variable_name | Value | +--------------------------+----------------------

  • Linux, mysql encoding modified 2011-07-25

    Windows will not even play to understand, suddenly to change mysql under Linux the default encoding, Intuit worry. . . Most used: mysql basic command, Linux under the VI command (never heard of, but fortunately Heige reminder, or I do not know it was

  • Changes on the mysql root password under linux problems encountered 2010-08-03

    Changes on the mysql root password under linux processes, can be found online a lot, probably is: # Killall mysqld / / interrupt the process currently running mysql # Mysqld_safe - skip-grant-tables & / / start in Safe Mode # Mysql / / no direct acce

  • Mysql commands used in Linux ubuntu (rpm) 2011-05-24

    Mysql commands used in Linux 1.linux start the mysql command: mysqladmin start / Ect / init.d / mysql start (in front of the mysql installation path) 2.linux to restart the mysql command: mysqladmin restart / Ect / init.d / mysql restart (in front of

  • MySQL安装与应用[Linux下的安装与配置] 2012-03-09

    Linux下的安装与配置 如果所安装的Linux系统没有内置的MySQL,笔者建议在Linux中使用RPM包来安装MySQL,同样这也是MySQL官方提供的建议.笔者接触最多的Linux系统是Radhat的"近亲":CentOS,由于CentOS较新的版本都内置了MySQL,因此在安装系统时就将MySQL安装并注册为系统服务,省去了不少工作量,此处也就不对Linux下的安装做太多陈述,仅提供部分资料供参考. 注意: MySQL至少需要Linux 2.0版本. 以下是网友提供的CentO

  • Tomcat 5 / 6 GBK encoding problems under the perfect solution Chinese form of filters 2010-03-21

    Tomcat 5 / 6 GBK encoding problems under the perfect solution Chinese form of filters Tomcat 5 common form after the submission of garbled code solution a lot, have to change Tomcat Connector properties, there are additional filters. But the Tomcat t

  • mysql related commands under linux (rookie learning) 2010-10-13

    Recently in learning mysql, or just rookie, so sharing under 1.linux start the mysql command: [Root @ localhost ~] # mysqladmin start / Ect / init.d / mysql start (in front of the mysql installation path) 2.linux next restart mysql command: [Root @ l

  • mysql encoding specified when creating a database 2010-10-15

    mysql encoding specified when creating a database is very important, many developers are using the default encoding, but I use the experience, the development of the database coding can be derived largely avoided brought into the garbage problem. We

  • MYSQL Installation Deployment Guide Linux platform 2010-12-21

    MYSQL Installation Deployment Guide Linux platform

  • How to change mysql encoding view 2011-03-03

    mysql> show Variables like 'char%'; You can view the mysql encoding: | Variable_name | Value | +--------------------------+---------------------- -----------------------------------+ | Character_set_client | utf8 | | Character_set_connection | utf8 |

  • Mysql运行环境优化(Linux系统) 2013-11-23

    这篇文章主要介绍了Mysql运行环境优化(Linux系统),本文优化了修改Linux默认的IO调度算法.扩大文件描述符.禁用numa特性.修改swappiness设置.优化文件系统挂载参数等配置,需要的朋友可以参考下 一.修改Linux默认的IO调度算法. linux默认的IO调度算法为cfq,需要修改为dealine,如果是SSD或者PCIe-SSD设备,需要修改为noop,可以使用下面两种修改方式. 1.在线动态修改,重启失效. echo "deadline" > /sys/

  • MySQL Concurrency Problems 2014-12-02

    MySQL Concurrency Problems 了解MySQL中出现的各种并发问题,在这里做一个总结: 摘自sql server中的例子http://technet.microsoft.com/en-us/library/aa213029%28v=sql.80%29.aspx,在mysql中同样存在这样的问题. Lost Updates Lost updates occur when two or more transactions select the same row and then

  • modify the default linux mysql encoding problem appears invalid 2011-05-26

    According to the online description. My.cnf file content changes 1. To find the cnf file location mysql find /-iname *. cnf 2. Casual copying one to the / etc / my.cnf - attention; originally I did not copy here. But in / etc / mysql / my.cnf which i

  • to modify the default linux mysql encoding problem appears invalid 2011-05-26

    According to the online description. Modify the my.cnf file content 1 to find the cnf file location mysql find /-iname *. cnf 2. Just copy one to the / etc / my.cnf - attention; I am not the original copy here. But in the / etc / mysql / my.cnf which

  • centos (linux) garbled under mysql encoding settings 2011-04-03

    Keywords: cent os (linux), MySQL, garbled cent os install mysql client and the server, the garbled, had to modify the code. Environment: cent os, mysql Note: On the difference between utf8 and gbk details see: Chinese garbled Linux solution , the fol

  • Elaborate on MySQL 5.1 under Linux installation steps 2010-05-27

    Linux environment MySQL5.1 installation steps: 1, download free install MySQL version / binary version of the software (not compiled) File Format: MYSQL-VERSION-OS.tar.gz 2, create a MySQL group, set up MySQL user and group to mysql (Different versio

  • MySQL configuration file under linux to explain [Reprinted 2010-07-24

    MySQL configuration file Source: [url] http://www.linuxidc.com/Linux/2009-04/19285.htm [/ url] MySQL to the latest products are actually exceeded by the carrying Red Hat Enterprise Linux version. However, the stability and open source, but very impor

  • ALTER TABLE in MySQL performance problems when 2010-03-15

    From: http://www.evget.com/zh-CN/Info/catalog/12561.html When a large table for ALTER TABLE when performance problems arise. MySQL most of the changes, follow these steps: Under the new table structure to create an empty table, the data from the old

  • Synchronization between MySQL database (windows and linux) 2010-08-25

    1. Exported windows mysql for linux mysql test database to the test library. (Or early the new database) 2.windows mysql edit my.ini ############## server-id = 1 log-bin = c: \ mymasterlog (master database log directory) binlog-do-db = test (to synch