Chinese garbled solution after GoDaddy database

Source: Internet
Author: User
Tags mssql server mysql tutorial table name access database mysql backup

Chinese garbled solution after the course of GoDaddy database


1. Use Notepad to open the backup good SQL text to ensure that the data in the file is displayed correctly.
2. View the storage format for this text, generally ANSI (Chinese generally refers to GBK or gb2312) and UTF-8.
3. If the file's storage format is ANSI, add the following statement at the top of the SQL file:
/*!40101 SET NAMES GBK * *;
If your file is stored in a UTF-8 format, add the following statement to the top of the SQL file:
/*!40101 SET NAMES UTF8 * *;
4. Save, and then use just the modified SQL file to restore the MySQL tutorial database, it should be done.

My MySQL backup file is too large, more than 300m,ultraedit,editplus are difficult to handle, the result of using Winhex directly modify the SQL file header to be done.

Finally, I started writing code, and I wrote a test code on the page that was the same as using a SQL Server database or an Access database, no different.


MSSQL SERVER ACCESSK Chinese garbled

Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Web;
Using System.Web.UI;
Using System.Web.UI.WebControls;
Using System.Data.OleDb;
Using System.Data;
Using MySql.Data.MySqlClient;

namespace S
{
public partial class _default:system.web.ui.page
{
<summary>
Wukong Note: The following code in the server address and database name and so I marked as Chinese, each according to their own situation to modify the code can be
Goku's Blog www.7es.cn
</summary>
<param name= "Sender" ></param>
<param name= "E" ></param>
protected void Page_Load (object sender, EventArgs e)
{
Goku's Blog Www.111cn.net
Mysqlconnection conn = new Mysqlconnection ("Server= server address; port=3306; database= database name; uid= user name; pwd= ' password ';
Conn. Open ();
Mysqlcommand cmd = new Mysqlcommand ("SELECT * from table name", conn);
Mysqldatareader dr = cmd. ExecuteReader ();
if (Dr. Read ())
{
Response.Write (dr["field name"). ToString ());
}
Dr. Close ();
Dr. Dispose ();
Cmd. Dispose ();
Response.Write ("<br>end");

}
}
}

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.