MariaDB字符集编码
来源:互联网 发布:下载wps0ff1ce软件 编辑:程序博客网 时间:2024/05/27 20:35
原文链接:http://blog.sina.com.cn/s/blog_8ea8e9d50102vv1z.html
Welcome to the MariaDB monitor.
Your MariaDB connection id is 2
Server version: 5.5.41-MariaDB MariaDB Server
Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> SHOW VARIABLES LIKE 'character%';
+--------------------------+----------------------------+
| Variable_name
+--------------------------+----------------------------+
| character_set_client
| character_set_connection | utf8
| character_set_database
| character_set_filesystem | binary
| character_set_results
| character_set_server
| character_set_system
| character_sets_dir
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
MariaDB [(none)]> SHOW VARIABLES LIKE 'collation%';
+----------------------+-------------------+
| Variable_name
+----------------------+-------------------+
| collation_connection | utf8_general_ci
| collation_database
| collation_server
+----------------------+-------------------+
3 rows in set (0.00 sec)
1. SET NAMES 'utf8';
2. 创建数据库是指定编码
MariaDB [(none)]> CREATE DATABASE foo CHARACTER SET utf8;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> USE foo;
Database changed
MariaDB [foo]> SHOW VARIABLES LIKE 'character%';
+--------------------------+----------------------------+
| Variable_name
+--------------------------+----------------------------+
| character_set_client
| character_set_connection | utf8
| character_set_database
| character_set_filesystem | binary
| character_set_results
| character_set_server
| character_set_system
| character_sets_dir
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
MariaDB [foo]> SHOW VARIABLES LIKE 'collation%';
+----------------------+-------------------+
| Variable_name
+----------------------+-------------------+
| collation_connection | utf8_general_ci
| collation_database
| collation_server
+----------------------+-------------------+
3 rows in set (0.00 sec)
示例:
CREATE TABLE mytable
(
columnn1 INT,
columnn2 VARCHAR(10)
)DEFAULT CHARACTER SET
CREATE OR REPLACE TABLE mytable
(columnn1 INT,
columnn2 VARCHAR(10),
column3 VARCHAR(10)
)DEFAULT CHARACTER SET
SELECT * FROM customers ORDER BY lastname, firstname
ALTER DATABASE database_name CHARACTER SET utf8;
ALTER TABLE table_name CHARACTER SET utf8;
MariaDB [foo]> DESC hello;
+-------+----------+------+-----+---------+-------+
| Field | Type
+-------+----------+------+-----+---------+-------+
| id
| name
+-------+----------+------+-----+---------+-------+
2 rows in set (0.00 sec)
MariaDB [foo]> ALTER TABLE hello MODIFY name char(50) CHARACTER SET utf8;
Query OK, 0 rows affected (0.00 sec)
Records: 0
Welcome to the MariaDB monitor.
Your MariaDB connection id is 2
Server version: 5.5.41-MariaDB MariaDB Server
Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> SHOW VARIABLES LIKE 'collation%';
+----------------------+-----------------+
| Variable_name
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database
| collation_server
+----------------------+-----------------+
3 rows in set (0.00 sec)
MariaDB [(none)]> SHOW VARIABLES LIKE 'character%';
+--------------------------+----------------------------+
| Variable_name
+--------------------------+----------------------------+
| character_set_client
| character_set_connection | utf8
| character_set_database
| character_set_filesystem | binary
| character_set_results
| character_set_server
| character_set_system
| character_sets_dir
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
init_connect =
init_connect =
character_set_server =
collation_server =
init_connect =
init_connect =
character_set_server =
collation_server =
- MariaDB字符集编码
- mariadb字符集
- MariaDB 5.5 字符集
- mariadb设置字符集为utf8mb4
- MariaDB安装及字符集配置
- MariaDB中文乱码字符集处理
- 字符集和字符集编码
- 字符集编码
- 字符集编码
- 字符集编码
- 字符集编码
- 字符集编码
- 字符集编码
- 字符集编码
- 字符集编码
- 字符集编码
- 字符集编码
- 字符集编码
- P1125 笨小猴
- 个性
- ioc容器源码分析(一)
- React diff
- Java回调
- MariaDB字符集编码
- HashMap源码解析
- Android 6.0 动态权限 官方指导
- SpreadJS 纯前端表格控件推出新版本,正式支持Angular 2
- Java并发编程之CountDownLatch
- JAVA内存区域之栈
- adb命令
- .net core 项目文件结构浅析
- 文件和目录属性