MySQL:用问号代替符号
我在MariaDB中创建了一个数据库,然后运行了一些SQL来创建表 像这样:MySQL:用问号代替符号,mysql,sql,encoding,utf-8,Mysql,Sql,Encoding,Utf 8,我在MariaDB中创建了一个数据库,然后运行了一些SQL来创建表 像这样: create table customers ( customerid int unsigned not null auto_increment primary key, name char(50) not null, address char(100) not null, city char(30) not null ); create table
create table customers
( customerid int unsigned not null auto_increment primary key,
name char(50) not null,
address char(100) not null,
city char(30) not null
);
create table orders
( orderid int unsigned not null auto_increment primary key,
customerid int unsigned not null,
amount float(6,2),
date date not null
);
然后我尝试用一些数据填充它:
insert into customers values
(3, "Саша Валентей", "12, ул. Гудвина", "г. Изумрудный"),
(4, "Ева Легкая", "34, пр. Незнайки", "г. Солнечный"),
(5, "Слава Моргунов", "56, пер. Поттера", "пгт Хогвартс");
insert into orders values
(NULL, 3, 69.98, "2008-04-02"),
(NULL, 1, 49.99, "2008-04-15"),
(NULL, 2, 74.98, "2008-04-19"),
(NULL, 3, 24.99, "2008-05-01");
这是西里尔语,如果有关系的话。现在我有了问号,我的
chars应该是。我的服务器是UTF-8,该表似乎是拉丁语和瑞典语。如何解决此问题?尝试以下方法:
ALTER TABLE customers CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
这将修复该表,以便进一步使用西里尔文,但无法恢复已插入的数据。(没有解决办法)他为什么不直接删除然后重新插入数据呢?是的,这可能就是要做的事情。