继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

MySQL 命令行代码学习

HakunaMatatacoc
关注TA
已关注
手记 3
粉丝 5
获赞 1

mysql> prompt \h
PROMPT set to '\h'
localhost prompt \u@\h \d>
PROMPT set to 'prompt \u@\h \d>'
prompt root@localhost (none)>prompt \u@\h \d
PROMPT set to '\u@\h \d'
root@localhost (none) SELECT VERSION();
+------------+
| VERSION() |
+------------+
| 5.7.17-log |
+------------+
1 row in set (0.00 sec)

root@localhost (none)SELECT NOW();
+---------------------+
| NOW() |
+---------------------+
| 2017-03-21 19:46:40 |
+---------------------+
1 row in set (0.00 sec)

root@localhost (none)SELECT USER();
+----------------+
| USER() |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)

root@localhost (none)CREATE DATABASE t1;
ERROR 1007 (HY000): Can't create database 't1'; database exists
root@localhost (none)CREATE DATABASE IF NOT EXISTS t1;
Query OK, 1 row affected, 1 warning (0.00 sec)

root@localhost (none)SHOW WARNINGS;
+-------+------+---------------------------------------------+
| Level | Code | Message |
+-------+------+---------------------------------------------+
| Note | 1007 | Can't create database 't1'; database exists |
+-------+------+---------------------------------------------+
1 row in set (0.00 sec)

root@localhost (none)SHOW DATABASES
-> ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sakila |
| sys |
| t1 |
| t2 |
| world |
+--------------------+
8 rows in set (0.03 sec)

打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP