hibernate - Set CENTOS 6 mysql character sets to UTF8 -


I have a website, and I realized that when you copy some letters ( *, '- _ ) Specific words like Microsoft Word, from a search box on your website, gives this error:

  error org.hibernate.util.JDBCExceptionReporter - collations (of invalid Mix 'latin1_swedish_ci', hidden) and 'choice' for (utf8_general_ci, compelled) operation  

Then I went to check my database and I Database wanted to see the use of UTF-8.

  mysql> Describe the characters '% character%'; + -------------------------- + -------- -------------- ------ + | Variable_name | Value | + ----------------------- --- + ---------------------- ------ + | Character_set_client | Utf8 | Character_set_connection | Utf8 | Character_set_database | Latin1 | | Character_set_file system | Binary | | Character_s_t_sults | UTF8 | | Character_set_services | Latin 1 | Character_set_system | UTF8 | | Character_sets_rate | / Usr / share / mysql / charsets / | + -------------------------- + ---------------------- ------ + set in 8 rows (0.00 seconds) mysql & gt; Show characters like '% Collation%'; + ---------------------- + ------------------- + | Variable_name | Price | + ---------------------- + ------------------- + | Collation_connection | Utf8_general_ci | | Collation_database | Latin 1_swedish_c | | Collation_server | Latin 1_swedish_c | + ---------------------- + ------------------- +  

As you can see, the database is using latin1 and I wanted to set it to use utf8 . So first, I am on the Centos 6.2 server and the file resides in the file my.cnf file /etc/my.cnf and the file

[mysqld] local infile = 0 DATADIR = / var / lib / mysql socket = / var / lib / mysql: as [mysqld] is as follows /mysql.sock user = disabling mysql symbolic links # Mixed security risk symbolic link = 0 init_connect = 'set name UTF8' character_set_server = UTF8 collation_server = utf8_general_ci

PS I to stop Recommended [client] Not concerned about C because it indicates that it uses the utf8 under the value of the character_set_client .

Problem:

Although I have tried to set up the server in my my.cnf file (and the file Shut down my tomcat and restarted my concrete) nothing is changing, and when I run the first query that I showed, it still shows that character_set_server still using latin1

Although my TOMCAT Resumption Despite having done no effect, but for the changes I actually had to resume 'mysql'. You must first stop the main server (in my case Stop TOMCAT ) and then restart mySQL and then start TOMCAT again. After, in your MySQL if you type: show character like% character%; You should see your database datatype with utf-8 and you type:. You should also see your database matching data type which should be utf-8_general_ci like % match


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -