查看數(shù)據(jù)庫(kù)編碼格式 如何查看設(shè)置mysql數(shù)據(jù)庫(kù)編碼方式?
如何查看設(shè)置mysql數(shù)據(jù)庫(kù)編碼方式?1. 查看數(shù)據(jù)庫(kù)編碼格式MySQL> show variables like “character set database”2。查看數(shù)據(jù)表MySQL>
如何查看設(shè)置mysql數(shù)據(jù)庫(kù)編碼方式?
1. 查看數(shù)據(jù)庫(kù)編碼格式MySQL> show variables like “character set database”2。查看數(shù)據(jù)表MySQL> show create table 3的編碼格式。創(chuàng)建數(shù)據(jù)庫(kù)mysql時(shí)指定數(shù)據(jù)庫(kù)的字符集>創(chuàng)建數(shù)據(jù)庫(kù)字符集utf84。在創(chuàng)建數(shù)據(jù)表5時(shí)指定數(shù)據(jù)表的編碼格式。修改數(shù)據(jù)庫(kù)mysql> alter database character set utf86的編碼格式。修改數(shù)據(jù)表的編碼格式MySQL> alter table Character set utf87,修改字段編碼格式
1,查看數(shù)據(jù)庫(kù)編碼格式
MySQL> show variables like “Character set database”
2。查看數(shù)據(jù)表的編碼格式
MySQL> show create table< table name>
3。創(chuàng)建數(shù)據(jù)庫(kù)時(shí)指定數(shù)據(jù)庫(kù)的字符集
MySQL> create database< database name> character set utf8
4。創(chuàng)建數(shù)據(jù)表時(shí)指定數(shù)據(jù)表的編碼格式
name varchar(45)not null,
price double not null,
bookcount int not null,
author varchar(45)not null)default charset=utf8
5。修改數(shù)據(jù)庫(kù)編碼格式
MySQL>alter database< database name> character set utf8
6。修改數(shù)據(jù)表編碼格式
MySQL>alter table< table name> character set utf8
7。修改段編碼格式
MySQL>alter table user change username varchar(20)字符集utf8 not null