偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

MySQL命令行插入中文出錯的解決

數(shù)據(jù)庫 MySQL
MySQL命令行使用時有時會遇到插入中文失敗的問題,下文就為您介紹一個解決該問題的方法,希望對您能有所啟迪。

最近安裝MySQL,使用了UTF-8 ,鍵表使用了UTF-8,遇到了MySQL命令行插入中文出錯的問題。

在Query Browser中直接插入中文沒有問題.

  1. create table student(  
  2. id varchar(100) not null default '',  
  3. name varchar(20) default '',  
  4. cardId varchar(20) not null default '',  
  5. age int(3) default '0',  
  6. primary key (id),  
  7. unique key (cardId)  
  8. )engine=InnoDB default charset=utf8;  
  9.  

但是在MySQL命令行中插入中文,居然不行.

設(shè)置環(huán)境為UTF8,插入仍然失敗.

  1. set names utf8;  
  2.  

解決:

  1. set names gbk;  
  2.  
  3. insert into student(id,name,cardId,age) values('1234','偉','05120492',24);  
  4.  

成功.

 

 

【編輯推薦】

MySQL無重復(fù)查詢的實(shí)現(xiàn)

五種常用的MySQL命令行

MySQL命令行亂碼問題的解決

修復(fù)mysql表的兩種方法

php中數(shù)組插入mysql表的方法

責(zé)任編輯:段燃 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2010-11-24 15:16:12

MySQL命令行登陸

2010-11-24 15:22:51

MySQL命令行

2009-08-07 10:33:53

linux命令行亂碼linux命令行解決方式

2010-11-24 15:33:59

mysql命令行參數(shù)

2015-07-01 09:15:46

linuxQuora命令行

2010-10-12 17:13:43

MySQL命令行

2010-11-24 15:41:56

MySQL命令行

2022-02-08 13:24:49

LinuxLinux命令

2022-02-08 17:19:05

Linux命令grep

2010-03-24 14:08:10

CentOS命令行

2010-05-17 15:41:26

2010-11-24 17:12:17

MySQL命令行

2010-10-12 17:01:21

MySQL命令行

2010-10-12 17:29:22

MySQL命令行

2010-11-24 14:51:55

Mysql命令行

2020-12-10 16:16:08

工具代碼開發(fā)

2020-12-11 06:44:16

命令行工具開發(fā)

2017-03-08 19:00:59

Linuxsudo命令

2010-10-12 17:23:40

MySQL命令行

2010-11-24 16:35:01

MYSQL命令行
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號