1 -- --------------------------------------------------------
2 -- SQL Commands to set up the pmadb as described in Documentation.html.
4 -- This file is meant for use with MySQL 4.1.2 and above!
5 -- For older MySQL releases, please use create_tables.sql
7 -- If you are running one MySQL 4.1.0 or 4.1.1, please create the tables using
8 -- create_tables.sql and upgrade their collation settings according to our
11 -- This script expects the user pma to already be existing. If we would put a
12 -- line here to create him too many users might just use this script and end
13 -- up with having the same password for the controluser.
15 -- This user "pma" must be defined in config.inc.php (controluser/controlpass)
17 -- Please don't forget to set up the tablenames in config.inc.php
21 -- --------------------------------------------------------
24 -- Database : `phpmyadmin`
26 CREATE DATABASE IF NOT EXISTS `phpmyadmin`
27 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
30 -- --------------------------------------------------------
35 -- (activate this statement if necessary)
36 -- GRANT SELECT, INSERT, DELETE, UPDATE ON `phpmyadmin`.* TO
39 -- --------------------------------------------------------
42 -- Table structure for table `pma_bookmark`
45 CREATE TABLE IF NOT EXISTS `pma_bookmark` (
46 `id` int(11) NOT NULL auto_increment,
47 `dbase` varchar(255) NOT NULL default '',
48 `user` varchar(255) NOT NULL default '',
49 `label` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default '',
50 `query` text NOT NULL,
53 ENGINE=MyISAM COMMENT='Bookmarks'
54 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
56 -- --------------------------------------------------------
59 -- Table structure for table `pma_column_info`
62 CREATE TABLE IF NOT EXISTS `pma_column_info` (
63 `id` int(5) unsigned NOT NULL auto_increment,
64 `db_name` varchar(64) NOT NULL default '',
65 `table_name` varchar(64) NOT NULL default '',
66 `column_name` varchar(64) NOT NULL default '',
67 `comment` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default '',
68 `mimetype` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default '',
69 `transformation` varchar(255) NOT NULL default '',
70 `transformation_options` varchar(255) NOT NULL default '',
72 UNIQUE KEY `db_name` (`db_name`,`table_name`,`column_name`)
74 ENGINE=MyISAM COMMENT='Column information for phpMyAdmin'
75 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
77 -- --------------------------------------------------------
80 -- Table structure for table `pma_history`
83 CREATE TABLE IF NOT EXISTS `pma_history` (
84 `id` bigint(20) unsigned NOT NULL auto_increment,
85 `username` varchar(64) NOT NULL default '',
86 `db` varchar(64) NOT NULL default '',
87 `table` varchar(64) NOT NULL default '',
88 `timevalue` timestamp(14) NOT NULL,
89 `sqlquery` text NOT NULL,
91 KEY `username` (`username`,`db`,`table`,`timevalue`)
93 ENGINE=MyISAM COMMENT='SQL history for phpMyAdmin'
94 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
96 -- --------------------------------------------------------
99 -- Table structure for table `pma_pdf_pages`
102 CREATE TABLE IF NOT EXISTS `pma_pdf_pages` (
103 `db_name` varchar(64) NOT NULL default '',
104 `page_nr` int(10) unsigned NOT NULL auto_increment,
105 `page_descr` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default '',
106 PRIMARY KEY (`page_nr`),
107 KEY `db_name` (`db_name`)
109 ENGINE=MyISAM COMMENT='PDF relation pages for phpMyAdmin'
110 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
112 -- --------------------------------------------------------
115 -- Table structure for table `pma_relation`
118 CREATE TABLE IF NOT EXISTS `pma_relation` (
119 `master_db` varchar(64) NOT NULL default '',
120 `master_table` varchar(64) NOT NULL default '',
121 `master_field` varchar(64) NOT NULL default '',
122 `foreign_db` varchar(64) NOT NULL default '',
123 `foreign_table` varchar(64) NOT NULL default '',
124 `foreign_field` varchar(64) NOT NULL default '',
125 PRIMARY KEY (`master_db`,`master_table`,`master_field`),
126 KEY `foreign_field` (`foreign_db`,`foreign_table`)
128 ENGINE=MyISAM COMMENT='Relation table'
129 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
131 -- --------------------------------------------------------
134 -- Table structure for table `pma_table_coords`
137 CREATE TABLE IF NOT EXISTS `pma_table_coords` (
138 `db_name` varchar(64) NOT NULL default '',
139 `table_name` varchar(64) NOT NULL default '',
140 `pdf_page_number` int(11) NOT NULL default '0',
141 `x` float unsigned NOT NULL default '0',
142 `y` float unsigned NOT NULL default '0',
143 PRIMARY KEY (`db_name`,`table_name`,`pdf_page_number`)
145 ENGINE=MyISAM COMMENT='Table coordinates for phpMyAdmin PDF output'
146 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
148 -- --------------------------------------------------------
151 -- Table structure for table `pma_table_info`
154 CREATE TABLE IF NOT EXISTS `pma_table_info` (
155 `db_name` varchar(64) NOT NULL default '',
156 `table_name` varchar(64) NOT NULL default '',
157 `display_field` varchar(64) NOT NULL default '',
158 PRIMARY KEY (`db_name`,`table_name`)
160 ENGINE=MyISAM COMMENT='Table information for phpMyAdmin'
161 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
163 -- --------------------------------------------------------
166 -- Table structure for table `pma_designer_coords`
169 CREATE TABLE IF NOT EXISTS `pma_designer_coords` (
170 `db_name` varchar(64) NOT NULL default '',
171 `table_name` varchar(64) NOT NULL default '',
176 PRIMARY KEY (`db_name`,`table_name`)
178 ENGINE=MyISAM COMMENT='Table coordinates for Designer'
179 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;