Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ MySQL display operation control tips     - Boot-Repair Tool - repair of frequent start-up problems (Linux)

- Regular expressions in Perl (Programming)

- MySQL Statistics (Database)

- ASP.NET 5 tutorial series (Server)

- Using IntelliJ IDEA 13 integrated development environment to build Android (Linux)

- shellinabox: one uses AJAX Web-based terminal emulator (Linux)

- Linux account management add relevant directives (Linux)

- Java string intern constant pool resolution Introduction (Programming)

- Nginx installation configuration Zabbix (Server)

- Linux firewall settings instance (Linux)

- iOS in Singleton (Programming)

- Install multiple Linux distributions and Fedora 21 first experience on the same hard disk (Linux)

- Protect against network attacks using Linux system firewall (Linux)

- 5 fast Node.js application performance tips (Programming)

- Nginx supports user multi-threaded downloads and resume broken (Server)

- In-depth summary of the PHP core of object-oriented (Programming)

- Nginx high concurrency optimization ideas (Server)

- CentOS installation of the ftp (Linux)

- Installation of Python2.7.8 and iPython under CentOS6.5 (Linux)

- Proxmox VE implement KVM OpenVZ virtualization cloud computing (Server)

 
         
  MySQL display operation control tips
     
  Add Date : 2018-11-21      
         
       
         
  MySQL show format

First, the G display the results in rows perpendicular

Unused

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 | almatrostelgt3776@yahoo.com | | 2015-02-15 09:40:54 | | 0 | NicholaJorgenson |

| 3 | ElvinMoney | $ P $ BebFywousFh0mVmoqHEWAx7IofQmEJ0 | elvinmoney | alizanoguera@mailcatch.com | | 2015-02-15 10:04:36 | | 0 | ElvinMoney |

+ ---- + ------------------ + ------------------------- ----------- + ------------------ + ------------------- ---------- + ---------- + --------------------- + ------ --------------- + ------------- + ---------------- +

2 rows in set (0.00 sec)

use

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: almatrostelgt3776@yahoo.com

          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: alizanoguera@mailcatch.com

          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)

Second, using a pager to set the page

pager 'more' This mode displays the page, and then wait for the button to display a

pager 'less' in this mode will show a waiting button displays an additional line

nopager this mode directly to the most complete display

Third, the use tee to save operating results to a file, similar to Oracle in the spool command

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 | almatrostelgt3776@yahoo.com | | 2015-02-15 09:40:54 | | 0 | NicholaJorgenson |

| 3 | ElvinMoney | $ P $ BebFywousFh0mVmoqHEWAx7IofQmEJ0 | elvinmoney | alizanoguera@mailcatch.com | | 2015-02-15 10:04:36 | | 0 | ElvinMoney |

+ ---- + ------------------ + ------------------------- ----------- + ------------------ + ------------------- ---------- + ---------- + --------------------- + ------ --------------- + ------------- + ---------------- +

2 rows in set (0.00 sec)

mysql> notee

[Mysql @ sam ~] $

Fourth, the direct execution of operating system commands

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

Fifth, execute SQL script file

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 | almatrostelgt3776@yahoo.com | | 2015-02-15 09:40:54 | | 0 | NicholaJorgenson |

| 3 | ElvinMoney | $ P $ BebFywousFh0mVmoqHEWAx7IofQmEJ0 | elvinmoney | alizanoguera@mailcatch.com | | 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>

Sixth, modify the command prompt

mysql> prompt \ u @ \ h (\ d) \ r: \ m: \ s:>

PROMPT set to '\ u @ \ h (\ d) \ r: \ m: \ s:>'

 sam @ localhost (wordpress) 03:15:28:>
     
         
       
         
  More:      
 
- MySQL completely uninstall and install Configuring Character Sets under Linux (Database)
- Linux SVN account password to save your settings (Linux)
- MySQL stored procedures and triggers (Database)
- Ubuntu install Eclipse for C / C ++ and related configuration (Linux)
- Ubuntu iptables prevent IP attacks (Linux)
- Docker: Mirroring and container operations (Server)
- Installation on the way to the root source Ubuntu Server 14.04 LTS version Odoo8.0 (Server)
- Linux Defensive / mitigate DDOS attacks (Linux)
- Revive Adserver ad server installation on Ubuntu 15.04 / CentOS7 (Server)
- Mount and unloading disks under Linux (Linux)
- Ubuntu 14.10 install KDE Plasma 5.2 (Linux)
- Use SVN to automatically deploy code under Apache (Server)
- Memcached and Redis (Linux)
- Ubuntu the ARP (arptables) (Linux)
- VPS xen openvz kvm (Server)
- Ubuntu 14.04 How to set up an SSH without password (Linux)
- How to install and configure the KVM and Open vSwitch on Linux distributions (Linux)
- Github Remote Assistance (Linux)
- C ++ containers (Programming)
- To install Xen in Ubuntu 12.04 (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.