CenterOS 64-bit modified mysql5.5.25 default encoding

  

view mysql default encoding format
show variables like “character%”; If the reality-bash: show: command not found Description does not log in mysql database, The login result needs to be as shown below:
View mysql default encoding


Modify my.cnf file
directory is /etc/my.cnf if there is no my.cnf file in the system You need to create this file. For details, see the step <Find the file ending with .cnf>. If it exists, skip the step <Find the file ending with .cnf>, go directly to the step <Edit my.cnf File>

Find the file ending with .cnf
Command find /-iname *.cnf -print result as shown in the figure:
Find the file ending with .cnf will search result set /usr/share Copy any file in the /mysql directory to the /etc/directory. Command: cp /usr/share/mysql/my-large.cnf /etc/my.cnf

Edit my.cnf file
Command: vi /etc/my,cnf under the [client] add default-character-set=utf8 under [ mysqld ] add character_set_server=utf8init _connect=’SET NAMES utf8′ (or SET NAMES & lsquo;utf8′) Online said to add default-character-set=utf8 under [mysql] I tested it is not possible, because mysqld does not recognize it, so I changed Become character_set_server=utf8

restart mysql
service mysql restart

Linux environment description
1, if you just need to install mysql, then you only need to install the following file MySQL-server-5.5 .25-1.rhel5MySQL-devel-5.5.25-1.rhel5MySQL-client-5.5.25-1.rhel52, if you need to build Linux implementation environment (nginx, php, mysql, tomcat, jdk, server multi-domain configuration Please refer to my Linux project implementation series tutorial
:CenterOS 6.3 64-bit build nginx1.3+php5.4.3+mysql5.5.25+tomcat7+jdk7 installation

Copyright © Windows knowledge All Rights Reserved