mysql8基础 create database...charset 创建数据库并指定字符集和排序规则

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/shiwanwu/article/details/88044847
  •        OS : Ubuntu 18.04.1 LTS
  •        DBMS : mysql 8.0.12
  •        blog : blog.csdn.net/shiwanwu
  •  typesetting : Markdown

数据,数据,命根就在数据 ! 操作数据库时,一定要谨慎小心。师万物 的代码看看就好,要有自己的判断。遇到抉择,要不耻上下问。

example

stu@Ubuntu:~$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 60
Server version: 8.0.12 MySQL Community Server - GPL

Copyright (c) 2000, 2018, 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> show databases;
+--------------------+
| Database           |
+--------------------+
| employees          |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.00 sec)

mysql> create database db_herbal_medicine default character set utf8 collate utf8_general_ci;
Query OK, 1 row affected, 1 warning (0.03 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| db_herbal_medicine |
| employees          |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
6 rows in set (0.00 sec)

mysql> show create database db_herbal_medicine;
+--------------------+-----------------------------------------------------------------------------+
| Database           | Create Database                                                             |
+--------------------+-----------------------------------------------------------------------------+
| db_herbal_medicine | CREATE DATABASE `db_herbal_medicine` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+--------------------+-----------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> exit
Bye
stu@Ubuntu:~$ 

resource


MySQL是关系型数据库管理系统,目前是开源的(2019-02)。
明确权限,恰当地选择引擎与字符集等,规范命名。
MariaDB,Redis,MongoDB,PostgreSQL,Hive,HBase等,多作了解,拓宽心量。
Workbench,phpMyAdmin,Navicat等图形化管理工具,豫兮若冬涉川。

展开阅读全文

没有更多推荐了,返回首页