English 中文(简体)
• 使MySQL在我的cnf配置档案中与utf-8合作
原标题:Making MySQL work with utf-8 in my.cnf configuration file

我有麻烦试图改变我的SQL的特性。 I m试图用“http://stackoverflow.com/questions/3513773/change-mysql-default-character-set-to-utf8-in-my-cnf”提供的信息编辑“etc/my.cnf”。 问题在于,在我的档案中添加这一信息(以及从互联网上抽取的许多其他信息),MySQL服务器没有开端(在进行变革时)。 我收到这一信息:

[root@tribals ~] # /etc/init.d/mysql restart
Shutting down MySQL.. SUCCESS!
Starting MySQL................................... ERROR!

更具体地说,Ill还张贴了“M.cnf”档案的内容:

[mysql]
default-character-set=utf8

[client]
default-character-set=utf8

[mysqld]
max_connections=200
query_cache_type=1
query_cache_size=2M
query_cache_limit=1M
ft_min_word_len=2
ft_max_word_len=20
ft_stopword_file=  

在最后一行之后,在档案底部添加有关果园的新内容。 这里,Im补充说:

default-character-set = utf8    
collation-server = utf8_unicode_ci
init-connect= SET NAMES utf8 
character-set-server = utf8

感谢!

Edit: Hi, 这里的标识是:

111111 20:18:00  mysqld started 111111 20:18:00  InnoDB: Started; log sequence number 0 72790
111111 20:18:00 [Warning]  ./mysql/host  had no or invalid character set, and default character set is multi-byte, so character column sizes may have changed
111111 20:18:00 [Warning]  ./mysql/user  had no or invalid character set, and default character set is multi-byte, so character column sizes may have changed
111111 20:18:00 [Warning]  ./mysql/db  had no or invalid character set, and default character set is multi-byte, so character column sizes may have changed
111111 20:18:00 [ERROR] Fatal error: mysql.user table is damaged or in unsupported 3.20 format.
111111 20:18:00  mysqld ended

PD:Sorry, I m new to this, cann t que how to do it...

最佳回答

Got it!!! Looks like this is a problem when updating MySQL versions, in my case, from 3.2 to 4.1.22. The thing is that the privilege tables must be updated too, but somehow they weren t. So, I logged into the server as root via SSH and executed the command:

mysql_fix_privilege_tables --password=[your_root_pass]

!! 希望能帮助我的其他人......

问题回答

暂无回答




相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签