首页 > 其他分享 >set character_set_database=utf8;set character_set_server=utf8;

set character_set_database=utf8;set character_set_server=utf8;

时间:2023-05-22 11:32:29浏览次数:42  
标签:set utf8 character sec student mysql row

D:\mysql-5.6.24-win32\bin\mysql  -uroot 

 Welcome to the MySQL monitor.  Commands end with ; or \g. 

 Your MySQL connection id is 55 

 Server version: 5.6.24 MySQL Community Server (GPL) 



 Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. 



 Oracle is a registered trademark of Oracle Corporation and/or its 

 affiliates. Other names may be trademarks of their respective 

 owners. 



 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 



 mysql> lsb_release -a 

     -> ; 

 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that 

 corresponds to your MySQL server version for the right syntax to use near 'lsb_r 

 elease -a' at line 1 

 mysql> show variables like'%char%' 

     -> ; 

 +--------------------------+---------------------------------------+ 

 | Variable_name            | Value                                 | 

 +--------------------------+---------------------------------------+ 

 | character_set_client     | gbk                                   | 

 | character_set_connection | gbk                                   | 

 | character_set_database   | latin1                                | 

 | character_set_filesystem | binary                                | 

 | character_set_results    | gbk                                   | 

 | character_set_server     | latin1                                | 

 | character_set_system     | utf8                                  | 

 | character_sets_dir       | D:\mysql-5.6.24-win32\share\charsets\ | 

 +--------------------------+---------------------------------------+ 

 8 rows in set (0.00 sec) 



 mysql> show database; 

 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that 

 corresponds to your MySQL server version for the right syntax to use near 'datab 

 ase' at line 1 

 mysql> show databases; 

 +--------------------+ 

 | Database           | 

 +--------------------+ 

 | information_schema | 

 | hibernate          | 

 | mysql              | 

 | performance_schema | 

 | test               | 

 +--------------------+ 

 5 rows in set (0.17 sec) 



 mysql> create database test2; 

 Query OK, 1 row affected (0.40 sec) 



 mysql> show databases; 

 +--------------------+ 

 | Database           | 

 +--------------------+ 

 | information_schema | 

 | hibernate          | 

 | mysql              | 

 | performance_schema | 

 | test               | 

 | test2              | 

 +--------------------+ 

 6 rows in set (0.00 sec) 



 mysql> show create database test2; 

 +----------+------------------------------------------------------------------+ 

 | Database | Create Database                                                  | 

 +----------+------------------------------------------------------------------+ 

 | test2    | CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET latin1 */ | 

 +----------+------------------------------------------------------------------+ 

 1 row in set (0.00 sec) 



 mysql> set character_set_database=utf8; 

 Query OK, 0 rows affected (0.07 sec) 



 mysql> set character_set_server=utf8; 

 Query OK, 0 rows affected (0.00 sec) 



 mysql> create database test3; 

 Query OK, 1 row affected (0.13 sec) 



 mysql> show create database test3; 

 +----------+----------------------------------------------------------------+ 

 | Database | Create Database                                                | 

 +----------+----------------------------------------------------------------+ 

 | test3    | CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET utf8 */ | 

 +----------+----------------------------------------------------------------+ 

 1 row in set (0.00 sec) 



 mysql> show variables like'%char%'; 

 +--------------------------+---------------------------------------+ 

 | Variable_name            | Value                                 | 

 +--------------------------+---------------------------------------+ 

 | character_set_client     | gbk                                   | 

 | character_set_connection | gbk                                   | 

 | character_set_database   | utf8                                  | 

 | character_set_filesystem | binary                                | 

 | character_set_results    | gbk                                   | 

 | character_set_server     | utf8                                  | 

 | character_set_system     | utf8                                  | 

 | character_sets_dir       | D:\mysql-5.6.24-win32\share\charsets\ | 

 +--------------------------+---------------------------------------+ 

 8 rows in set (0.00 sec) 



 mysql> use test3; 

 Database changed 

 mysql> create table student(id int,name varchar(50)); 

 Query OK, 0 rows affected (1.42 sec) 



 mysql> show create table student; 

 +---------+--------------------------------------------------------------------- 

 ---------------------------------------------------------+ 

 | Table   | Create Table 

                                                          | 

 +---------+--------------------------------------------------------------------- 

 ---------------------------------------------------------+ 

 | student | CREATE TABLE `student` ( 

   `id` int(11) DEFAULT NULL, 

   `name` varchar(50) DEFAULT NULL 

 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 | 

 +---------+--------------------------------------------------------------------- 

 ---------------------------------------------------------+ 

 1 row in set (0.15 sec) 



 mysql> use test2; 

 Database changed 

 mysql> create table student(id int,name varchar(50)); 

 Query OK, 0 rows affected (0.60 sec) 



 mysql> show create table student; 

 +---------+--------------------------------------------------------------------- 

 -----------------------------------------------------------+ 

 | Table   | Create Table 

                                                            | 

 +---------+--------------------------------------------------------------------- 

 -----------------------------------------------------------+ 

 | student | CREATE TABLE `student` ( 

   `id` int(11) DEFAULT NULL, 

   `name` varchar(50) DEFAULT NULL 

 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | 

 +---------+--------------------------------------------------------------------- 

 -----------------------------------------------------------+ 

 1 row in set (0.02 sec) 



 mysql> insert into student values(1,'小明'); 

 Query OK, 1 row affected, 1 warning (0.11 sec) 



 mysql> select * from student; 

 +------+------+ 

 | id   | name | 

 +------+------+ 

 |    1 | ??   | 

 +------+------+ 

 1 row in set (0.00 sec) 



 mysql> use test3; 

 Database changed 

 mysql> insert into student values(1,'小明'); 

 Query OK, 1 row affected (0.05 sec) 



 mysql> select * from student; 

 +------+------+ 

 | id   | name | 

 +------+------+ 

 |    1 | 小明 | 

 +------+------+ 

 1 row in set (0.00 sec) 



 mysql>

标签:set,utf8,character,sec,student,mysql,row
From: https://blog.51cto.com/gjwrxz/6322261

相关文章

  • [atARC156F]Make Same Set
    考虑网络流,具体建图如下:整张图共\(4\)层,用\((i,j)\)表示第\(i\)层的第\(j\)个点,则边集包含从\(S\)向\((1,i)\)连流量为\(1\)的边从\((1,i)\)向\((2,a_{i})\)和\((2,b_{i})\)连流量为\(1\)的边从\((2,i)\)向\((3,i)\)连流量为\(1\)的边从\((3,a_{i})\)和\((3,c_{i})\)向\((4,......
  • 踩坑:nacos启动报错提示需要设置JDK环境 ,报错:ERROR: Please set the JAVA_HOME variabl
    换了个Windows11的新电脑,因为个人工作、学习需要,就重新下载了Nacos并解压使用,结果就踩了个坑,使用下面命令启动Nacos服务端时:startup.cmd-mstandalone直接在黑窗口提示:ERROR:PleasesettheJAVA_HOMEvariableinyourenvironment,Weneedjava(x64)!jdk8orlaterisbet......
  • 史上最全的WebSettings说明
    setAllowContentAccess(booleanallow) 是否允许在WebView中访问内容URL(ContentUrl),默认允许。内容Url访问允许WebView从安装在系统中的内容提供者载入内容。setAllowFileAccess(booleanallow) 是否允许访问文件,默认允许。注意,这里只是允许或禁止对文件系统的访问,Assets和re......
  • Vue进阶(九十八):Vue.set() 和 this.$set()
    (文章目录)一、应用场景有时候我们会看到如下代码:在我们使用vue进行开发的过程中,可能会遇到这样一种情况:当创建vue实例后,再次给对象赋值时,发现数据并不会自动更新到视图上去;当我们去阅读vue文档的时候,会发现有这么一句话:如果在实例创建之后添加新的属性到实例上,它不会触发视图......
  • Set集合
    set集合一直以来,JS只能使用数组和对象来保存多个数据,缺乏像其他语言那样拥有丰富的集合类型。因此,ES6新增了两种集合类型(set和map),用于在不同的场景中发挥作用。set用于存放不重复的数据如何创建set集合newSet();//创建一个没有任何内容的set集合newSet(iterable);......
  • Family of Solution Sets
      欢迎投歌词!评论告诉我歌曲链接和词就好啦~大概四五天一更?SolutionSet-“卷起击碎定论的漩涡”\(\to\)《夏虫》SolutionSet-“让季节停止哽咽”\(\to\)《凉雨》SolutionSet-“也许我们早已经共鸣在那约定之地”\(\to\)《视星等4.44》SolutionSet-......
  • 详解c++STL—容器set/multiset
    1、set基本概念1.1、功能所有元素都会在插入时自动被排序1.2、本质:set/multiset属于关联式容器,底层结构是用二叉树实现。1.3、set和multiset区别set不允许容器中有重复的元素multiset允许容器中有重复的元素2、set构造和赋值2.1、功能描述创建set容器以及赋值2.1、构造set<T>st;/......
  • 开发手记:Redis中zset查询的range
    问题描述从Redis中查询关注列表(使用zset存储),但是查询到的记录总是比应有的记录数少一个Set<Integer>targetIds=redisTemplate.opsForZSet().reverseRange(key,offset,offset+limit-1);调试于是去检查Redis中置顶键zset中的所有数据,发现自己对zset相关命令似乎并不太......
  • 【解决方法】家用路由器的复位/重置(reset)操作,解决管理员后台密码遗忘
    环境:工具:家用路由器系统版本:Windows10问题描述:描述:用户是有线连接到路由器,因为网络出现问题,需要登录到后台,在登录路由器后台时,密码不对,故需要进行重置操作解决方法-视频与文字教程:视频教程:文字教程:1.找到路由器,并查看复位(reset)按钮,路由器复位键有两种类型:RESET按......
  • nginx proxy_set部分常见配置
    目录nginxproxy_set部分常见配置nginxproxy_set部分常见配置proxy_set_headerHost$host;#用途:设置要发送到代理服务器的HTTP请求头的Host字段。$host变量将被替换为客户端请求中的实际主机名。proxy_set_headerConnection"";#用途:清空要发送到代理服务器的HTTP请求头......