From db23658fdc1d4baafb390867235c7009fb75b070 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 23 Jul 2004 17:47:33 +0000 Subject: [PATCH] now 2 scripts to create tables for the infrastructure --- ChangeLog | 4 + Documentation.html | 205 ++++++++++----------------------------------- 2 files changed, 49 insertions(+), 160 deletions(-) diff --git a/ChangeLog b/ChangeLog index 30dfec29f..59e8a7b07 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2004-07-23 Marc Delisle + * Documentation.html: take into account the new script to + create tables for the infrastructure + 2004-07-23 Alexander M. Turek * config.inc.php, libraries/config_import.lib.php, libraries/select_lang.lib.php: Made phpMyAdmin aware that there is a diff --git a/Documentation.html b/Documentation.html index 76bca8dec..d0beab8c6 100755 --- a/Documentation.html +++ b/Documentation.html @@ -165,18 +165,32 @@ in your browser. phpMyAdmin should now display a welcome screen and your databases, or a login dialog if using HTTP or cookie authentication mode. -
  • For a whole set of new features (bookmarks, comments, SQL-history, PDF-generation, field contents transformation, etc.) - you need to create a set of tables in your database. Please look at your scripts/ + + +

    Linked-tables infrastructure

    +

    + For a whole set of new features (bookmarks, comments, SQL-history, + PDF-generation, field contents transformation, etc.) + you need to create a set of special tables. Those tables can be located + in your own database, or in a central database for a multi-user + installation (this database would then be accessed by the controluser, + so no other user should have rights to it). +

    + Please look at your scripts/ directory, where you should find a file called create_tables.sql. (If you are using a Windows server, pay special attention to FAQ 1.23). If your MySQL server's version is 4.1.2 or later, please use create_tables_mysql_4_1_2+.sql instead. You can already use your phpMyAdmin to create the tables for you. Please be - aware that you may have to have special (administrator) privileges to create - the database and tables. After having imported the create_tables.sql file, - you should specify the table names in your config.inc.php file. The directives - used for that can be found in the Configuration section.

  • - - + aware that you may need special (administrator) privileges to create + the database and tables, and that the script may need some tuning, + depending on the database name. +

    + After having imported the create_tables.sql file, + you should specify the table names in your config.inc.php file. The directives + used for that can be found in the Configuration section. + You will also need to have a controluser with the proper rights to + those tables (see section Using authentication modes below). +

    Upgrading from an older version

      @@ -589,45 +603,19 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost'; $cfg['Servers'][$i]['pmadb'] string
      - Starting with version 2.3.0 phpMyAdmin offers a lot of features - to work with master / foreign - tables. To use those as well as - the bookmark feature you need special tables with a - predefined structure, which we explain below. + The name of the database containing the linked-tables infrastructure.

      - See the Quick Install section in this document for a quick way - of creating those tables. Also, if you are using a Windows server, - read FAQ 1.23. + See the Linked-tables infrastructure + section in this document to see the benefits of this infrastructure, + and for a quick way of creating this database and the needed tables.

      If you are the only user of this phpMyAdmin installation, you can use your current database to store those special tables; in this case, just put your current database name in - $cfg['Servers'][$i]['pmadb']. + $cfg['Servers'][$i]['pmadb']. For a multi-user installation, + set this parameter to the name of your central database containing + the linked-tables infrastructure.

      - If you are setting up a multi-user phpMyAdmin installation, - you will need to create a new database and setup special privileges, - so, as superuser: -

      -
        -
      • - create a new database for phpMyAdmin:
        -   CREATE DATABASE phpmyadmin;
        - If using MySQL 4.1.2 or later, use instead:
        -   CREATE DATABASE phpmyadmin DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
        - Note that "controluser" must have - SELECT, INSERT, UPDATE and DELETE - privileges on this database. Here is a query to set up - those privileges (using "phpmyadmin" - as the database name, and "pma" as the - controluser):
        - -   GRANT SELECT,INSERT,UPDATE,DELETE ON phpmyadmin.* to 'pma'@'localhost'; -
        - do not give any other user rights on this database. -
      • -
      • - enter the database name in $cfg['Servers'][$i]['pmadb'] -
      • -

      @@ -638,22 +626,9 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost'; Since release 2.2.0 phpMyAdmin allows to bookmark queries. This can be useful for queries you often run.

      - To allow the usage of this functionality you have to: + To allow the usage of this functionality:
        -
      • set up "pmadb" as described above
      • -
      • within this database create a table following this scheme: -
        - -      CREATE TABLE `pma_bookmark` (
        -        id int(11) DEFAULT '0' NOT NULL auto_increment,
        -        dbase varchar(255) NOT NULL,
        -        user varchar(255) NOT NULL,
        -        label varchar(255) NOT NULL,
        -        query text NOT NULL,
        -        PRIMARY KEY (id)
        -      ) TYPE=MyISAM COMMENT='Bookmarks';
        -
        -
      • +
      • set up pmadb and the linked-tables infrastructure
      • enter the table name in $cfg['Servers'][$i]['bookmarktable']

      @@ -701,25 +676,9 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost'; The keys can be numeric or character.

      - To allow the usage of this functionality the superuser has to: + To allow the usage of this functionality:
        -
      • set up "pmadb" as described above
      • -
      • - within this database create a table following this scheme: -
        - -      CREATE TABLE `pma_relation` (
        -        `master_db` varchar(64) NOT NULL default '',
        -        `master_table` varchar(64) NOT NULL default '',
        -        `master_field` varchar(64) NOT NULL default '',
        -        `foreign_db` varchar(64) NOT NULL default '',
        -        `foreign_table` varchar(64) NOT NULL default '',
        -        `foreign_field` varchar(64) NOT NULL default '',
        -        PRIMARY KEY (`master_db`, `master_table`, `master_field`),
        -        KEY foreign_field (foreign_db, foreign_table)
        -      ) TYPE=MyISAM COMMENT='Relation table';
        -
        -
      • +
      • set up pmadb and the linked-tables infrastructure
      • put the relation table name in $cfg['Servers'][$i]['relation'] @@ -746,20 +705,9 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost';
        This configuration variable will hold the name of this special table. - To allow the usage of this functionality the superuser has to: + To allow the usage of this functionality:
          -
        • set up "pmadb" as described above
        • -
        • within this database create a table following this scheme: -
          - -      CREATE TABLE `pma_table_info` (
          -        `db_name` varchar(64) NOT NULL default '',
          -        `table_name` varchar(64) NOT NULL default '',
          -        `display_field` varchar(64) NOT NULL default '',
          -        PRIMARY KEY (`db_name`, `table_name`)
          -      ) TYPE=MyISAM COMMENT='Table information for phpMyAdmin';
          -
          -
        • +
        • set up pmadb and the linked-tables infrastructure
        • put the table name in $cfg['Servers'][$i]['table_info'] @@ -785,43 +733,14 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost'; pages) and "table_coords" (storing coordinates where each table will be placed on a PDF schema output).

          - You must be using the "relation" feature and have a table of - PDF pages (see $cfg['Servers'][$i]['pdf_pages']) to create PDF - output. + You must be using the "relation" feature.

          - To allow the usage of this functionality the superuser has to: + To allow the usage of this functionality:
            -
          • set up "pmadb" as described above
          • +
          • set up pmadb and the linked-tables infrastructure
          • - within this database create a table following this scheme: -
            - -      CREATE TABLE `pma_table_coords` (
            -        `db_name` varchar(64) NOT NULL default '',
            -        `table_name` varchar(64) NOT NULL default '',
            -        `pdf_page_number` int NOT NULL default '0',
            -        `x` float unsigned NOT NULL default '0',
            -        `y` float unsigned NOT NULL default '0',
            -        PRIMARY KEY (`db_name`, `table_name`, `pdf_page_number`)
            -      ) TYPE=MyISAM COMMENT='Table coordinates for phpMyAdmin PDF output';
            -
            -
          • -
          • - also within this database create:
            - -      CREATE TABLE `pma_pdf_pages` (
            -        `db_name` varchar(64) NOT NULL default '',
            -        `page_nr` int(10) unsigned NOT NULL auto_increment,
            -        `page_descr` varchar(50) NOT NULL default '',
            -        PRIMARY KEY (page_nr),
            -        KEY (db_name)
            -      ) TYPE=MyISAM COMMENT='PDF Relationpages for PMA';
            -
            -
          • -
          • - put the first table name in - $cfg['Servers'][$i]['table_coords'] - and the second table name in + put the correct table names in + $cfg['Servers'][$i]['table_coords'] and $cfg['Servers'][$i]['pdf_pages']

          @@ -848,33 +767,15 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost'; for further information. To use the MIME-transformation system, your column_info table has to have the three new fields 'mimetype', 'transformation', 'transformation_options'.

          - To allow the usage of this functionality the superuser has to: + To allow the usage of this functionality:
            -
          • set up "pmadb" as described above
          • -
          • - within this database create a table following this scheme: -
            - -      CREATE TABLE `pma_column_info` (
            -        id int(5) unsigned NOT NULL auto_increment,
            -        db_name varchar(64) NOT NULL default '',
            -        table_name varchar(64) NOT NULL default '',
            -        column_name varchar(64) NOT NULL default '',
            -        `comment` varchar(255) NOT NULL default '',
            -        mimetype varchar(255) NOT NULL default '',
            -        transformation varchar(255) NOT NULL default '',
            -        transformation_options varchar(255) NOT NULL default '',
            -        PRIMARY KEY (id),
            -        UNIQUE KEY db_name (db_name, table_name, column_name)
            -      ) TYPE=MyISAM COMMENT='Comments for Columns';
            -
            -
          • +
          • set up pmadb and the linked-tables infrastructure
          • put the table name in $cfg['Servers'][$i]['column_info']
          • - To update your PRE-2.5.0 Column_comments Table use this:
            + to update your PRE-2.5.0 Column_comments Table use this:
                 ALTER TABLE `pma_column_comments`
                   ADD `mimetype` VARCHAR( 255 ) NOT NULL ,
            @@ -905,25 +806,9 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost'; see $cfg['QueryFrame'].

            - To allow the usage of this functionality the superuser has to: + To allow the usage of this functionality:
              -
            • set up "pmadb" as described above
            • -
            • - within this database create a table following this scheme: -
              - -      CREATE TABLE `pma_history` (
              -        `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
              -        `username` VARCHAR( 64 ) NOT NULL ,
              -        `db` VARCHAR( 64 ) NOT NULL ,
              -        `table` VARCHAR( 64 ) NOT NULL ,
              -        `timevalue` TIMESTAMP NOT NULL ,
              -        `sqlquery` TEXT NOT NULL ,
              -        PRIMARY KEY ( `id` ) ,
              -        INDEX ( `username` , `db` , `table` , `timevalue` )
              -        ) TYPE=MyISAM COMMENT='SQL history';
              -
              -
            • +
            • set up pmadb and the linked-tables infrastructure
            • put the table name in $cfg['Servers'][$i]['history']