|
\g.
Your MySQL connection id is 49
Server version: 5.5.44-log Source distribution
Copyright (c) 2000, 2015, 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> use sakila;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
abc@ubuntu:~$ mysql -uroot -p(密码) -e 'use sakila;select * from payment limit 5;';
+------------+-------------+----------+-----------+--------+---------------------+---------------------+
| payment_id | customer_id | staff_id | rental_id | amount | payment_date | last_update |
+------------+-------------+----------+-----------+--------+---------------------+---------------------+
| 1 | 1 | 1 | 76 | 2.99 | 2005-05-25 11:30:37 | 2006-02-15 22:12:30 |
| 2 | 1 | 1 | 573 | 0.99 | 2005-05-28 10:35:23 | 2006-02-15 22:12:30 |
| 3 | 1 | 1 | 1185 | 5.99 | 2005-06-15 00:54:12 | 2006-02-15 22:12:30 |
| 4 | 1 | 2 | 1422 | 0.99 | 2005-06-15 18:02:53 | 2006-02-15 22:12:30 |
| 5 | 1 | 2 | 1476 | 9.99 | 2005-06-15 21:08:46 | 2006-02-15 22:12:30 |
+------------+-------------+----------+-----------+--------+---------------------+---------------------+
abc@ubuntu:~$ mysql -uroot -p(密码) -e 'use sakila;select * from payment limit 5;' -E;
*************************** 1. row ***************************
payment_id: 1
customer_id: 1
staff_id: 1
rental_id: 76
amount: 2.99
payment_date: 2005-05-25 11:30:37
last_update: 2006-02-15 22:12:30
*************************** 2. row ***************************
payment_id: 2
customer_id: 1
staff_id: 1
rental_id: 573
amount: 0.99
payment_date: 2005-05-28 10:35:23
last_update: 2006-02-15 22:12:30
*************************** 3. row ***************************
payment_id: 3
customer_id: 1
staff_id: 1
rental_id: 1185
amount: 5.99
payment_date: 2005-06-15 00:54:12
last_update: 2006-02-15 22:12:30
*************************** 4. row ***************************
payment_id: 4
customer_id: 1
staff_id: 2
rental_id: 1422
amount: 0.99
payment_date: 2005-06-15 18:02:53
last_update: 2006-02-15 22:12:30
*************************** 5. row ***************************
payment_id: 5
customer_id: 1
staff_id: 2
rental_id: 1476
amount: 9.99
payment_date: 2005-06-15 21:08:46
last_update: 2006-02-15 22:12:30
abc@ubuntu:~$ cd ~/Downloads/
abc@ubuntu:~/Downloads$ mkdir mysql
abc@ubuntu:~/Downloads$ cd mysql/
abc@ubuntu:~/Downloads/mysql$ vi a.sql;
(在此步添加了一些内容)
abc@ubuntu:~/Downloads/mysql$ more a.sql;
insert into t2 values (1);
insert into t2 values (2222222222222222222222222);
insert into t2 values (3);
abc@ubuntu:~/Downloads/mysql$ mysql -uroot -p(密码);
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 53
Server version: 5.5.44-log Source distribution
Copyright (c) 2000, 2015, 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 sta |