mysql8基础 create database if not exists... 若数据库不存在则创建
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了mysql8基础 create database if not exists... 若数据库不存在则创建,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2755字,纯文字阅读大概需要4分钟。
内容图文
![mysql8基础 create database if not exists... 若数据库不存在则创建](/upload/InfoBanner/zyjiaocheng/916/6d9d62f1f2db47d884afd65bfdf554c6.jpg)
- ???? 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 91
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 |
+--------------------+
| db_herbal_medicine |
| employees |
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
6 rows in set (0.01 sec)
mysql> create database if not exists db_herbal_medicine;
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql> show warnings;
+-------+------+-------------------------------------------------------------+
| Level | Code | Message |
+-------+------+-------------------------------------------------------------+
| Note | 1007 | Can't create database 'db_herbal_medicine'; database exists |
+-------+------+-------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> drop database db_herbal_medicine;
Query OK, 0 rows affected (0.01 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| employees |
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
mysql> create database if not exists db_herbal_medicine;
Query OK, 1 row affected (0.04 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| db_herbal_medicine |
| employees |
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
6 rows in set (0.00 sec)
mysql> exit
Bye
stu@Ubuntu:~$
resource
- [手册] dev.mysql.com/doc
- [源码] downloads.mysql.com/archives/community
- [Bug ] bugs.mysql.com
- [ 测试数据 ] github.com/datacharmer/test_db
- [规范 - 参考] yq.aliyun.com/articles/69327
- [排名 - 参考] db-engines.com/en
- [平台] www.csdn.net
MySQL是关系型数据库管理系统,目前是开源的(2019-02)。
明确权限,恰当地选择引擎与字符集等,规范命名。
MariaDB,Redis,MongoDB,PostgreSQL,Hive,HBase等,多作了解,拓宽心量。
Workbench,phpMyAdmin,Navicat等图形化管理工具,豫兮若冬涉川。
内容总结
以上是互联网集市为您收集整理的mysql8基础 create database if not exists... 若数据库不存在则创建全部内容,希望文章能够帮你解决mysql8基础 create database if not exists... 若数据库不存在则创建所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。