doubianyu7844
2013-01-30 09:44
采纳率: 0%
浏览 63
已采纳

从mysql 5.5降级到5.1,utf-8 general_ci

i am using wamp for localhost, its mysql version is 5.5. After i finished my website i wanted to upload it to my website (shared hosting). which runs (5.1) but i cant insert arabic letters anymore.

when i insert any field in arabic, it gets stored as weird characters "ضووع".

it was doing great on my pc, but not online.

the database is myisam by default, but all tables are innodb with utf8_general_ci. also this is the same database i used on my machine (innodb by default) (I've imported it into my new database on the shared hosting).

so far i tried those things after making the connection

mysql_set_charset('utf8');

and

mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET COLLATION_CONNECTION = 'utf8_unicode_ci'");

what can i do more?

图片转代码服务由CSDN问答提供 功能建议

我正在使用wamp for localhost,它的mysql版本是5.5。 在我完成我的网站后,我想将其上传到我的网站(共享主机)。 运行(5.1),但我不能再插入阿拉伯字母了。</ p>

当我在阿拉伯语中插入任何字段时,它会被存储为奇怪的字符“ضÙÙع”。</ p>

它在我的电脑上运行得很好,但不是在线。</ p>

默认情况下数据库是myisam,但是所有表都是innodb,带有utf8_general_ci。 也这是同一个数据库 我在我的机器上使用(默认情况下是innodb)(我已将它导入我在共享主机上的新数据库中)。</ p>

到目前为止我在连接后尝试了这些东西</ p >

 <代码> mysql_set_charset( 'UTF8'); 
 </代码> </ PRE> 
 
 

和</ p>

 <代码>  mysql_query(“SET NAMES'utf8'”); 
mysql_query(“SET CHARACTER SET utf8”); 
mysql_query(“SET COLLATION_CONNECTION ='utf8_unicode_ci'”); 
 </ code> </ pre> 
 
 <  p>我还能做些什么?</ p> 
 </ div>

2条回答 默认 最新

相关推荐 更多相似问题