×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles
    Revision as of 13:14, 9 February 2005 by imported>mutante
    (diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

    The world's most popular open source database.


    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;
    +------------------+
    | Tables_in_wikidb |
    +------------------+
    | archive          |
    | blobs            |
    ...
    | imagelinks       |
    | interwiki        |
    ...
    | watchlist        |
    +------------------+
    23 rows in set (0.00 sec)
    

    Getting field names

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

    Selecting content

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

    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";
    +------------------------------------------+
    | iw_url                                   |
    +------------------------------------------+
    | http://www.usemod.com/cgi-bin/wiki.pl?$1 |
    +------------------------------------------+
    1 row in set (0.00 sec)
    

    .. to be extended ...

    External Links

    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.