标签:
1.mysql> select NOW();等效于select user()\g
+---------------------+
| NOW() |
+---------------------+
| 2015-11-07 10:29:04 |
+---------------------+
1 row in set (0.00 sec)
mysql> select NOW(),USER(),VERSION();
+---------------------+----------------+-----------------+
| NOW() | USER() | VERSION() |
+---------------------+----------------+-----------------+
| 2015-11-07 10:32:18 | root@localhost | 5.5.35-1ubuntu1 |
+---------------------+----------------+-----------------+
1 row in set (0.00 sec)
mysql> select NOW(),USER(),VERSION()\g
+---------------------+----------------+-----------------+
| NOW() | USER() | VERSION() |
+---------------------+----------------+-----------------+
| 2015-11-07 10:35:37 | root@localhost | 5.5.35-1ubuntu1 |
+---------------------+----------------+-----------------+
1 row in set (0.00 sec)
mysql> select NOW(),USER(),VERSION()\G
*************************** 1. row ***************************
NOW(): 2015-11-07 10:35:41
USER(): root@localhost
VERSION(): 5.5.35-1ubuntu1
1 row in set (0.00 sec)
取消
mysql> select user(),
-> now(),
-> \c
mysql>
创建数据库
mysql> create database sampdb;
Query OK, 1 row affected (0.02 sec)
mysql> select database();
+------------+
| database() |
+------------+
| NULL |
+------------+
1 row in set (0.00 sec)
mysql> use sampdb; $mysql sampdb -u root -p
$mysql -h hostname -u root -p sampdb
mysql> select database();
Database changed
+------------+
| database() |
+------------+
| sampdb |
+------------+
1 row in set (0.00 sec)
标签:
原文地址:http://www.cnblogs.com/guxuanqing/p/4944763.html