Analysis of Chinese garbled characters in phpadmin and MySQL

Source: Internet
Author: User

This article mainly describes the actual solutions for Chinese garbled characters in phpadmin and MySQL, as well as the actual application code in related operations, the following is a detailed analysis of the Article. We hope you will have a better understanding of the actual operation steps after browsing.

Solution to Chinese garbled characters between phpadmin and MySQL:

Find the libraries folder in the Phpmyadmin folder and modify the select_lang.lib.php file.

A) zh-gb2312 modified to zh-gb2312-utf-8

B) modify the MySQL_charset_map array.

 
 
  1. 'Gb2312' => 'utf-8' to 'gb2312' => 'latin1 ',

(Some display 'gb2312' => 'gb2312'. The same is true)

C) modify the MySQL_charset_map array.

 
 
  1. 'Utf-8' => 'utf-8' to 'utf-8' => 'latin1 ',

Restart httpd.

If VertrigoServ is used, restart VertrigoServ.

MySQL garbled solution:

Add the following content to config. inc. php In the Phpmyadmin Folder: <? Php?> Between)

Configure MySQL database connection Parameters

 
 
  1. $db =  mysql _connect("localhost", "user","password");  
  2. mysql_select_db("message",$db); 

Add the following line before executing the SQL statement.

 
 
  1. mysql_query("SET NAMES 'GBK'",$db); 

The above content describes how to solve the Chinese garbled characters in phpadmin and MySQL. I hope it will help you in this regard.



The above content describes the solutions to Chinese garbled characters in phpadmin and MySQL. I hope you will find some gains.

Original article title: phpadmin and MySQL Chinese garbled Problem Solution

Connection: http://www.cnblogs.com/sishierfei/archive/2009/11/25/1610519.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.