Mysql

The world's most popular open source database.


 * [MySQL Homepage]


 * [MySQL Documentation]


 * [Searchable Reference Manual]

Examples
The structure from top to bottom is: server->database->table->field->content

So get to the place you want in this order:

Connecting to mysql server from the shell.
shell> mysql -u root -p Enter password: Welcome to the MySQL monitor. mysql>

Switching into a database.
mysql> use wikidb; Database changed mysql>

Showing tables
mysql> show tables; +--+ +--+ ... ... +--+ 23 rows in set (0.00 sec)
 * Tables_in_wikidb |
 * archive         |
 * blobs           |
 * imagelinks      |
 * interwiki       |
 * watchlist       |

Getting field names
mysql> describe interwiki; +---++--+-+-+---+ +---++--+-+-+---+ +---++--+-+-+---+ 3 rows in set (0.00 sec)
 * Field    | Type       | Null | Key | Default | Extra |
 * iw_prefix | char(32)  |      | PRI |         |       |
 * iw_url   | char(127)  |      |     |         |       |
 * iw_local | tinyint(1) |      |     | 0       |       |

Selecting content
mysql> select iw_prefix from interwiki; +---+ +---+ ... +---+ 107 rows in set (0.00 sec)
 * iw_prefix        |
 * AbbeNormal       |
 * AcadWiki         |
 * Acronym          |
 * Advogato         |
 * AIWiki           |
 * Wiktionary       |
 * YpsiEyeball      |
 * ZWiki            |

You can use wildcard like in: mysql> select * from interwiki;

You can combine with conditions like in:

mysql> select iw_url from interwiki where iw_prefix="UseMod"; +--+ +--+ +--+ 1 row in set (0.00 sec)
 * iw_url                                  |
 * http://www.usemod.com/cgi-bin/wiki.pl?$1 |

.. to be extended ...