Encoding Problems:
There are four factors that affect MySQL encoding,
You can run the following command to View Details:
Mysql> Use db_name;
Mysql> statue;
We can see the following encoding:
Server characterset: utf8
DB characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
I don't know what these four points are, but if we unify all of them into one encoding, there will be no garbled characters:
Setting method:
Mysql> set names utf8;
If you use the source command to create tables and insert data using a script file, you must ensure that the script file is also UTF-8 encoded.
MySQL table, column addition, deletion
Add column:
Alter table table_name add column_name type;
Eg: alter table customer add memo varchar (500 );
Or: alter table customer add memo varchar (500) not null default '00 ';
Delete column:
Alter table table_name drop column column_name;
Eg: alter table customer drop column memo;
Modify column attributes:
Alter table table_name modify column_name type;
Eg: Alter customer modify memo char (300 );
Add constraints:
Add uniqueness constraint: alter table checked add constraint checked_unique_key unique (checknumber) Mysql Data Import and Export
Http://blog.chinaunix.net/uid-16844903-id-3411118.html
1. Export all data and table structures: mysqldump dbname> D:/1. SQL
2. Export the specified data and table structure: mysqldump dbname tablename1 tablename2 tablename3> D:/1. SQL
3. Only export all table structures (Table creation scripts): mysqldump-D dbname> D:/1. SQL
4. export only the specified table structure (Table creation script): mysqldump-D dbname tablename1 tablename2> D:/1. SQL
5. export only all insert statements: mysqldump-T dbname> D:/1. SQL
6. export only the insert statement of the specified table: mysqldump-T dbname tablename1 tablename2> D:/1. SQL
7, source D:/1. SQL