Version sans cache

Mise en cache désactivé. Réglage défaut pour cette page : actif (code DEF204)
Si l'affichage est trop lent, vous pouvez désactiver le mode utilisateur pour visualiser la version en cache.

Rechercher dans le manuel MySQL

25.41 Extensions to SHOW Statements

Some extensions to SHOW statements accompany the implementation of INFORMATION_SCHEMA:

  • SHOW can be used to get information about the structure of INFORMATION_SCHEMA itself.

  • Several SHOW statements accept a WHERE clause that provides more flexibility in specifying which rows to display.

INFORMATION_SCHEMA is an information database, so its name is included in the output from SHOW DATABASES. Similarly, SHOW TABLES can be used with INFORMATION_SCHEMA to obtain a list of its tables:

  1. mysql> SHOW TABLES FROM INFORMATION_SCHEMA;
  2. +---------------------------------------+
  3. | Tables_in_INFORMATION_SCHEMA          |
  4. +---------------------------------------+
  5. | CHARACTER_SETS                        |
  6. | COLLATIONS                            |
  7. | COLLATION_CHARACTER_SET_APPLICABILITY |
  8. | COLUMNS                               |
  9. | COLUMN_PRIVILEGES                     |
  10. | ENGINES                               |
  11. | EVENTS                                |
  12. | FILES                                 |
  13. | KEY_COLUMN_USAGE                      |
  14. | PARTITIONS                            |
  15. | PLUGINS                               |
  16. | PROCESSLIST                           |
  17. | REFERENTIAL_CONSTRAINTS               |
  18. | ROUTINES                              |
  19. | SCHEMATA                              |
  20. | SCHEMA_PRIVILEGES                     |
  21. | STATISTICS                            |
  22. | TABLES                                |
  23. | TABLE_CONSTRAINTS                     |
  24. | TABLE_PRIVILEGES                      |
  25. | TRIGGERS                              |
  26. | USER_PRIVILEGES                       |
  27. | VIEWS                                 |
  28. +---------------------------------------+

SHOW COLUMNS and DESCRIBE can display information about the columns in individual INFORMATION_SCHEMA tables.

SHOW statements that accept a LIKE clause to limit the rows displayed also permit a WHERE clause that specifies more general conditions that selected rows must satisfy:

The WHERE clause, if present, is evaluated against the column names displayed by the SHOW statement. For example, the SHOW CHARACTER SET statement produces these output columns:

  1. mysql> SHOW CHARACTER SET;
  2. +----------+-----------------------------+---------------------+--------+
  3. | Charset  | Description                 | Default collation   | Maxlen |
  4. +----------+-----------------------------+---------------------+--------+
  5. | big5     | Big5 Traditional Chinese    | big5_chinese_ci     |      2 |
  6. | dec8     | DEC West European           | dec8_swedish_ci     |      1 |
  7. | cp850    | DOS West European           | cp850_general_ci    |      1 |
  8. | hp8      | HP West European            | hp8_english_ci      |      1 |
  9. | koi8r    | KOI8-R Relcom Russian       | koi8r_general_ci    |      1 |
  10. | latin1   | cp1252 West European        | latin1_swedish_ci   |      1 |
  11. | latin2   | ISO 8859-2 Central European | latin2_general_ci   |      1 |
  12. ...

To use a WHERE clause with SHOW CHARACTER SET, you would refer to those column names. As an example, the following statement displays information about character sets for which the default collation contains the string 'japanese':

  1. mysql> SHOW CHARACTER SET WHERE `Default collation` LIKE '%japanese%';
  2. +---------+---------------------------+---------------------+--------+
  3. | Charset | Description               | Default collation   | Maxlen |
  4. +---------+---------------------------+---------------------+--------+
  5. | ujis    | EUC-JP Japanese           | ujis_japanese_ci    |      3 |
  6. | sjis    | Shift-JIS Japanese        | sjis_japanese_ci    |      2 |
  7. | cp932   | SJIS for Windows Japanese | cp932_japanese_ci   |      2 |
  8. | eucjpms | UJIS for Windows Japanese | eucjpms_japanese_ci |      3 |
  9. +---------+---------------------------+---------------------+--------+

This statement displays the multibyte character sets:

  1. mysql> SHOW CHARACTER SET WHERE Maxlen > 1;
  2. +---------+---------------------------+---------------------+--------+
  3. | Charset | Description               | Default collation   | Maxlen |
  4. +---------+---------------------------+---------------------+--------+
  5. | big5    | Big5 Traditional Chinese  | big5_chinese_ci     |      2 |
  6. | ujis    | EUC-JP Japanese           | ujis_japanese_ci    |      3 |
  7. | sjis    | Shift-JIS Japanese        | sjis_japanese_ci    |      2 |
  8. | euckr   | EUC-KR Korean             | euckr_korean_ci     |      2 |
  9. | gb2312  | GB2312 Simplified Chinese | gb2312_chinese_ci   |      2 |
  10. | gbk     | GBK Simplified Chinese    | gbk_chinese_ci      |      2 |
  11. | utf8    | UTF-8 Unicode             | utf8_general_ci     |      3 |
  12. | ucs2    | UCS-2 Unicode             | ucs2_general_ci     |      2 |
  13. | cp932   | SJIS for Windows Japanese | cp932_japanese_ci   |      2 |
  14. | eucjpms | UJIS for Windows Japanese | eucjpms_japanese_ci |      3 |
  15. +---------+---------------------------+---------------------+--------+

Rechercher dans le manuel MySQL

Traduction non disponible

Le manuel MySQL n'est pas encore traduit en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Document créé le 26/06/2006, dernière modification le 26/10/2018
Source du document imprimé : https://www.gaudry.be/mysql-rf-extended-show.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :en Manuel MySQL : https://dev.mysql.com/

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.

Table des matières Haut