mysql 学习---->修改表的字符集格式
2015-10-15 10:51
585 查看
1.导出与导入表(以修改表的字符集格式)
abc@ubuntu:~/Downloads$ mysqldump -uroot -p(密码) --default-character-set=gbk -d test1>test1.sql;
abc@ubuntu:~/Downloads$ mysqldump -uroot -p(密码) --quick --no-create-info --extended-insert --default-character-set=latin1 --no-create-info test1>testData.sql;
abc@ubuntu:~/Downloads$ mysql -uroot -p(密码)
mysql> create database test2 default charset gbk;
mysql> Ctrl-C -- exit!
Aborted
abc@ubuntu:~/Downloads$ mysql -uroot -p(密码) test2<test1.sql;
abc@ubuntu:~/Downloads$ mysql -uroot -p(密码) test2<testData.sql;
abc@ubuntu:~/Downloads$ mysql -uroot -p(密码)
mysql> show create table t_test \G;
*************************** 1. row ***************************
Table: t_test
Create Table: CREATE TABLE `t_test` (
`d` date DEFAULT NULL,
`t` time DEFAULT NULL,
`dt` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
ERROR:
No query specified
mysql> use test2;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show create table t_test \G;
*************************** 1. row ***************************
Table: t_test
Create Table: CREATE TABLE `t_test` (
`d` date DEFAULT NULL,
`t` time DEFAULT NULL,
`dt` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
ERROR:
No query specified
abc@ubuntu:~/Downloads$ mysqldump -uroot -p(密码) --default-character-set=gbk -d test1>test1.sql;
abc@ubuntu:~/Downloads$ mysqldump -uroot -p(密码) --quick --no-create-info --extended-insert --default-character-set=latin1 --no-create-info test1>testData.sql;
abc@ubuntu:~/Downloads$ mysql -uroot -p(密码)
mysql> create database test2 default charset gbk;
mysql> Ctrl-C -- exit!
Aborted
abc@ubuntu:~/Downloads$ mysql -uroot -p(密码) test2<test1.sql;
abc@ubuntu:~/Downloads$ mysql -uroot -p(密码) test2<testData.sql;
abc@ubuntu:~/Downloads$ mysql -uroot -p(密码)
mysql> show create table t_test \G;
*************************** 1. row ***************************
Table: t_test
Create Table: CREATE TABLE `t_test` (
`d` date DEFAULT NULL,
`t` time DEFAULT NULL,
`dt` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
ERROR:
No query specified
mysql> use test2;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show create table t_test \G;
*************************** 1. row ***************************
Table: t_test
Create Table: CREATE TABLE `t_test` (
`d` date DEFAULT NULL,
`t` time DEFAULT NULL,
`dt` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
ERROR:
No query specified
相关文章推荐
- MySQL:You can’t specify target table ‘A’ for update in FROM clause
- mysql 学习---->表优化、合成索引、浮点数与定点数
- mysql 学习----> 查看引擎、myisam引擎、自增长、主外键关联、memory引擎、merge引擎
- MySql乱码
- mysql 修改表结构脚本
- mysql 学习---->字符串、数值处理、日期、查询的逻辑处理、系统相关内容查询、IP地址相关、密码
- MySQL数据库
- mysql 学习---->数值计算、逻辑判断、范围选择、位运算
- mysql 学习---->字段
- MYSQL CLUSTER 7.4 + 5.6 创建磁盘表和内存表
- mysql ODBC 在64位下提示找不到odbc驱动问题
- MySQL information_schema 数据库
- mysql 学习----->查询,权限,字段控制
- Mysql_mysql force Index 强制索引
- codeigniter 操作mysql的PHP代码--更新
- MySQL 5.6内存占用过高解决方案
- PowerDesigner生成mysql字段comment注释
- MySql:备份与恢复数据库
- 多mysql环境(wamp和单独配置的环境同时存在)如何使用这个环境
- ubuntu install mysql