mysql.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Fri, 11 Dec 2015 18:30:50 +0200
changeset 1811 072cc8a704ce
parent 1810 752c192306ff
child 1836 4864231db031
permissions -rw-r--r--
List databases, tables, columns.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1809
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
.. -*- coding: utf-8; -*-
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
.. include:: HEADER.rst
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
================
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
 MySQL/MariaBD.
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
================
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
.. contents::
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
SQL clients.
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
============
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
1810
752c192306ff SQL clients.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1809
diff changeset
    12
  https://mariadb.com/kb/en/mariadb/clients-and-utilities/
752c192306ff SQL clients.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1809
diff changeset
    13
     Clients and Utilities.
752c192306ff SQL clients.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1809
diff changeset
    14
  https://mariadb.com/kb/en/mariadb/graphical-and-enhanced-clients/
752c192306ff SQL clients.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1809
diff changeset
    15
     Graphical and Enhanced Clients.
752c192306ff SQL clients.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1809
diff changeset
    16
1809
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
mysql.
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
------
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    19
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    20
Official client. Install ``mariadb-client`` package - ``mysql`` utility
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    21
will be installed with dependent package.
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    22
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    23
Usage::
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    24
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    25
  $ mysql -u $USER -p
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    26
  Enter password:   <== Type password.
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    27
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    28
mycli.
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    29
------
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    30
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    31
Python command line client with completion. Usage::
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    32
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    33
  $ mycli -u $USER
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    34
  Password:         <== Type password.
4e78b58a2935 MySQL/MariaBD.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    35
1811
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    36
List databases, tables, columns.
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    37
================================
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    38
::
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    39
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    40
  $ mysql -u $USER -p
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    41
  Enter password:   <== Type password.
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    42
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    43
  SHOW DATABASES;
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    44
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    45
  USE mysql;
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    46
  MariaDB [mysql]> SHOW TABLES;
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    47
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    48
  MariaDB [mysql]> SHOW COLUMNS FROM user;
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    49
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    50
  MariaDB [mysql]> DESCRIBE user;
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    51
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    52
  MariaDB [mysql]> SHOW STATUS;
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    53
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    54
  MariaDB [mysql]> SHOW CREATE DATABASE mysql;
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    55
  MariaDB [mysql]> SHOW CREATE TABLE user;
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    56
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    57
  MariaDB [mysql]> SHOW GRANTS;
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    58
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    59
  MariaDB [mysql]> SHOW WARNINGS;
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    60
  MariaDB [mysql]> SHOW ERRORS;
072cc8a704ce List databases, tables, columns.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1810
diff changeset
    61