mysql 顯現格式化
一、使用g按行垂直顯示結果
未使用mysql> select * from wp_users limit 1,2;
| id | user_login | user_pass | user_nicename | user_email | user_url | user_registered | user_activation_key | user_status | display_name |
| 2 | nicholajorgenson | $p$brlc6ljpc5i6ivcw4v2dthn.ztrxd/1 | nicholajorgenson | [email protected] | | 2015-02-15 09:40:54 | | 0 | nicholajorgenson |
| 3 | elvinmoney | $p$bebfywousfh0mvmoqhewax7iofqmej0 | elvinmoney | [email protected] | | 2015-02-15 10:04:36 | | 0 | elvinmoney |
2 rows in set (0.00 sec)
使用mysql> select * from wp_users limit 1,2\g;
*************************** 1. row ***************************
id: 2
user_login: nicholajorgenson
user_pass: $p$brlc6ljpc5i6ivcw4v2dthn.ztrxd/1
user_nicename: nicholajorgenson
user_email: [email protected]
user_url:
user_registered: 2015-02-15 09:40:54
user_activation_key:
user_status: 0
display_name: nicholajorgenson
*************************** 2. row ***************************
id: 3
user_login: elvinmoney
user_pass: $p$bebfywousfh0mvmoqhewax7iofqmej0
user_nicename: elvinmoney
user_email: [email protected]
user_url:
user_registered: 2015-02-15 10:04:36
user_activation_key:
user_status: 0
display_name: elvinmoney
2 rows in set (0.00 sec)
二、使用pager來設定翻頁
pager 'more' 此模式會顯示一頁,等待按鍵再顯示一頁
pager 'less' 此模式會顯示一頁,等待按鍵再顯示一行
nopager 此模式直接顯示到最完
三、使用tee儲存執行結果到檔案,類似於oracle中的spool命令
mysql> tee test.txt
logging to file 'test.txt'
select * from wp_users limit 1,2;
mysql> notee
mysql> quit
bye[mysql@sam ~]$ cat test.txt
mysql> select * from wp_users limit 1,2;
| id | user_login | user_pass | user_nicename | user_email | user_url | user_registered | user_activation_key | user_status | display_name |
| 2 | nicholajorgenson | $p$brlc6ljpc5i6ivcw4v2dthn.ztrxd/1 | nicholajorgenson | [email protected] | | 2015-02-15 09:40:54 | | 0 | nicholajorgenson |
| 3 | elvinmoney | $p$bebfywousfh0mvmoqhewax7iofqmej0 | elvinmoney | [email protected] | | 2015-02-15 10:04:36 | | 0 | elvinmoney |
2 rows in set (0.00 sec)
mysql> notee
[mysql@sam ~]$
四、直接執行作業系統命令
mysql> system ls -l
total 10092
-rw-rw-r-- 1 mysql mysql 1638854 apr 22 16:05 backup1.sql
-rw-rw-r-- 1 mysql mysql 1767787 apr 23 10:49 backup2.sql
-rw-rw-r-- 1 mysql mysql 13807 apr 23 09:48 backup3.sql
-rw-rw-r-- 1 mysql mysql 12258 apr 23 10:53 backup4.sql
-rw-rw-r-- 1 mysql mysql 2293238 apr 23 11:03 backup5.sql
-rw-rw-r-- 1 mysql mysql 2297583 apr 23 11:16 backup6.sql
-rw-rw-r-- 1 mysql mysql 2297579 apr 23 11:23 backup7.sql
-rw-rw-r-- 1 mysql mysql 1280 aug 26 11:18 test.txt
五、執行sql檔案指令碼
mysql> source 1.sql
| id | user_login | user_pass | user_nicename | user_email | user_url | user_registered | user_activation_key | user_status | display_name |
| 2 | nicholajorgenson | $p$brlc6ljpc5i6ivcw4v2dthn.ztrxd/1 | nicholajorgenson | [email protected] | | 2015-02-15 09:40:54 | | 0 | nicholajorgenson |
| 3 | elvinmoney | $p$bebfywousfh0mvmoqhewax7iofqmej0 | elvinmoney | [email protected] | | 2015-02-15 10:04:36 | | 0 | elvinmoney |
2 rows in set (0.00 sec)
mysql> system cat 1.sql
select * from wp_users limit 1,2;
mysql>
六、修改命令提示符
mysql> prompt \u@\h(\d) \r:\m:\s:>
prompt set to '\u@\h(\d) \r:\m:\s:>'
sam@localhost(wordpress) 03:15:28:>
mysql控制access mysql 表操作
建立表 簡單的方式 create table person number int 11 name varchar 255 birthday date 或者是create table if not exists person number int 11 name varchar 255 birthda...
mysql資料庫控制台 mysql 控制台操作
其實mysql的對資料庫的操作與其它的sql類資料庫大同小異,您最好找本將sql的書看看。一 連線mysql資料庫 1.首先開啟cmd進入dos視窗 2.切換至目錄 d mysql5.0 mysql 5.0.51b win32 bin 即 mysql安裝目錄下面的bin目錄,該目錄內有很多exe執行...
mysql分割槽實操
分成2步 2.將原表資料插入新錶 insert into 目標表 select from 表 create table met shopv2 order copy1 id int 11 not null auto increment,orderid varchar 20 character set ...