Nurlan
Nurlan

Reputation: 2960

change charset and collation of mysql database

How to configure MySQL database and asp.net project so that default character set was utf8 and collation was utf8_general_ci?

Upvotes: 0

Views: 2539

Answers (1)

HatSoft
HatSoft

Reputation: 11201

You can set the mysql databse as shown below or see more for other settings on this link http://dev.mysql.com/doc/refman/5.0/en/charset-applications.html

CREATE DATABASE mydb
  DEFAULT CHARACTER SET utf8
  DEFAULT COLLATE utf8_general_ci;

From ASP.NET you can set charset to UTF8 by the connectionstring

this way

"Server=DB_SERVER_NAME;Database=DBNAME;Uid=YOUR_ID;Pwd=YOUR_PASSWORD;Charset=utf8;"

Upvotes: 1

Related Questions