mysql5.7基础 create database if not exists... 判断数据库是否存在 若不存在则创建

时间:2018-02-03 20:04:51   收藏:0   阅读:1705

礼悟:
     公恒学思合行悟,尊师重道存感恩。叶见寻根三返一,江河湖海同一体。
          虚怀若谷良心主,愿行无悔给最苦。读书锻炼养身心,诚劝且行且珍惜。


 

 

  数据、数据,命根就在数据。操作数据库一定要谨慎小心。给最苦 这里的代码,看看就好,要有自己的判断。遇到抉择,要不耻上下问。 
               mysql:5.7
                     os:Windows7 x64

 

 

代码及效果

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| newbases           |
| performance_schema |
| test               |
+--------------------+
5 rows in set (0.00 sec)

mysql> create database if not exists newbases;
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| newbases           |
| performance_schema |
| test               |
+--------------------+
5 rows in set (0.00 sec)

mysql>

 

   


mysql,关系型数据库管理系统,优秀,值得学习。
学习资源:itcast和itheima视频库 + 清净的心地。
如果您有公开的资源,可以分享给我的话,用您的资源学习也可以。
博文是观看视频后,融入思考写成的。博文好,是老师讲得好。博文坏,是 给最苦 没认真。

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!