1 -- --------------------------------------------------------
2 -- SQL Commands to set up the pmadb as described in Documentation.html.
4 -- This file is meant for use with MySQL 5 and above!
6 -- This script expects the user pma to already be existing. If we would put a
7 -- line here to create him too many users might just use this script and end
8 -- up with having the same password for the controluser.
10 -- This user "pma" must be defined in config.inc.php (controluser/controlpass)
12 -- Please don't forget to set up the tablenames in config.inc.php
15 -- --------------------------------------------------------
18 -- Database : `phpmyadmin`
20 CREATE DATABASE IF NOT EXISTS `phpmyadmin`
21 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
24 -- --------------------------------------------------------
29 -- (activate this statement if necessary)
30 -- GRANT SELECT, INSERT, DELETE, UPDATE ON `phpmyadmin`.* TO
33 -- --------------------------------------------------------
36 -- Table structure for table `pma_bookmark`
39 CREATE TABLE IF NOT EXISTS `pma_bookmark` (
40 `id` int(11) NOT NULL auto_increment,
41 `dbase` varchar(255) NOT NULL default '',
42 `user` varchar(255) NOT NULL default '',
43 `label` varchar(255) COLLATE utf8_general_ci NOT NULL default '',
44 `query` text NOT NULL,
47 ENGINE=MyISAM COMMENT='Bookmarks'
48 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
50 -- --------------------------------------------------------
53 -- Table structure for table `pma_column_info`
56 CREATE TABLE IF NOT EXISTS `pma_column_info` (
57 `id` int(5) unsigned NOT NULL auto_increment,
58 `db_name` varchar(64) NOT NULL default '',
59 `table_name` varchar(64) NOT NULL default '',
60 `column_name` varchar(64) NOT NULL default '',
61 `comment` varchar(255) COLLATE utf8_general_ci NOT NULL default '',
62 `mimetype` varchar(255) COLLATE utf8_general_ci NOT NULL default '',
63 `transformation` varchar(255) NOT NULL default '',
64 `transformation_options` varchar(255) NOT NULL default '',
66 UNIQUE KEY `db_name` (`db_name`,`table_name`,`column_name`)
68 ENGINE=MyISAM COMMENT='Column information for phpMyAdmin'
69 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
71 -- --------------------------------------------------------
74 -- Table structure for table `pma_history`
77 CREATE TABLE IF NOT EXISTS `pma_history` (
78 `id` bigint(20) unsigned NOT NULL auto_increment,
79 `username` varchar(64) NOT NULL default '',
80 `db` varchar(64) NOT NULL default '',
81 `table` varchar(64) NOT NULL default '',
82 `timevalue` timestamp NOT NULL,
83 `sqlquery` text NOT NULL,
85 KEY `username` (`username`,`db`,`table`,`timevalue`)
87 ENGINE=MyISAM COMMENT='SQL history for phpMyAdmin'
88 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
90 -- --------------------------------------------------------
93 -- Table structure for table `pma_pdf_pages`
96 CREATE TABLE IF NOT EXISTS `pma_pdf_pages` (
97 `db_name` varchar(64) NOT NULL default '',
98 `page_nr` int(10) unsigned NOT NULL auto_increment,
99 `page_descr` varchar(50) COLLATE utf8_general_ci NOT NULL default '',
100 PRIMARY KEY (`page_nr`),
101 KEY `db_name` (`db_name`)
103 ENGINE=MyISAM COMMENT='PDF relation pages for phpMyAdmin'
104 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
106 -- --------------------------------------------------------
109 -- Table structure for table `pma_recent`
112 CREATE TABLE IF NOT EXISTS `pma_recent` (
113 `username` varchar(64) NOT NULL,
114 `tables` text NOT NULL,
115 PRIMARY KEY (`username`)
117 ENGINE=MyISAM COMMENT='Recently accessed tables'
118 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
120 -- --------------------------------------------------------
123 -- Table structure for table `pma_table_uiprefs`
126 CREATE TABLE IF NOT EXISTS `pma_table_uiprefs` (
127 `username` varchar(64) NOT NULL,
128 `db_name` varchar(64) NOT NULL,
129 `table_name` varchar(64) NOT NULL,
130 `prefs` text NOT NULL,
131 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
132 PRIMARY KEY (`username`,`db_name`,`table_name`)
134 ENGINE=MyISAM COMMENT='Tables'' UI preferences'
135 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
137 -- --------------------------------------------------------
140 -- Table structure for table `pma_relation`
143 CREATE TABLE IF NOT EXISTS `pma_relation` (
144 `master_db` varchar(64) NOT NULL default '',
145 `master_table` varchar(64) NOT NULL default '',
146 `master_field` varchar(64) NOT NULL default '',
147 `foreign_db` varchar(64) NOT NULL default '',
148 `foreign_table` varchar(64) NOT NULL default '',
149 `foreign_field` varchar(64) NOT NULL default '',
150 PRIMARY KEY (`master_db`,`master_table`,`master_field`),
151 KEY `foreign_field` (`foreign_db`,`foreign_table`)
153 ENGINE=MyISAM COMMENT='Relation table'
154 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
156 -- --------------------------------------------------------
159 -- Table structure for table `pma_table_coords`
162 CREATE TABLE IF NOT EXISTS `pma_table_coords` (
163 `db_name` varchar(64) NOT NULL default '',
164 `table_name` varchar(64) NOT NULL default '',
165 `pdf_page_number` int(11) NOT NULL default '0',
166 `x` float unsigned NOT NULL default '0',
167 `y` float unsigned NOT NULL default '0',
168 PRIMARY KEY (`db_name`,`table_name`,`pdf_page_number`)
170 ENGINE=MyISAM COMMENT='Table coordinates for phpMyAdmin PDF output'
171 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
173 -- --------------------------------------------------------
176 -- Table structure for table `pma_table_info`
179 CREATE TABLE IF NOT EXISTS `pma_table_info` (
180 `db_name` varchar(64) NOT NULL default '',
181 `table_name` varchar(64) NOT NULL default '',
182 `display_field` varchar(64) NOT NULL default '',
183 PRIMARY KEY (`db_name`,`table_name`)
185 ENGINE=MyISAM COMMENT='Table information for phpMyAdmin'
186 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
188 -- --------------------------------------------------------
191 -- Table structure for table `pma_designer_coords`
194 CREATE TABLE IF NOT EXISTS `pma_designer_coords` (
195 `db_name` varchar(64) NOT NULL default '',
196 `table_name` varchar(64) NOT NULL default '',
201 PRIMARY KEY (`db_name`,`table_name`)
203 ENGINE=MyISAM COMMENT='Table coordinates for Designer'
204 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
206 -- --------------------------------------------------------
209 -- Table structure for table `pma_tracking`
212 CREATE TABLE IF NOT EXISTS `pma_tracking` (
213 `db_name` varchar(64) NOT NULL,
214 `table_name` varchar(64) NOT NULL,
215 `version` int(10) unsigned NOT NULL,
216 `date_created` datetime NOT NULL,
217 `date_updated` datetime NOT NULL,
218 `schema_snapshot` text NOT NULL,
221 `tracking` set('UPDATE','REPLACE','INSERT','DELETE','TRUNCATE','CREATE DATABASE','ALTER DATABASE','DROP DATABASE','CREATE TABLE','ALTER TABLE','RENAME TABLE','DROP TABLE','CREATE INDEX','DROP INDEX','CREATE VIEW','ALTER VIEW','DROP VIEW') default NULL,
222 `tracking_active` int(1) unsigned NOT NULL default '1',
223 PRIMARY KEY (`db_name`,`table_name`,`version`)
225 ENGINE=MyISAM ROW_FORMAT=COMPACT COMMENT='Database changes tracking for phpMyAdmin'
226 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
228 -- --------------------------------------------------------
231 -- Table structure for table `pma_userconfig`
234 CREATE TABLE IF NOT EXISTS `pma_userconfig` (
235 `username` varchar(64) NOT NULL,
236 `timevalue` timestamp NOT NULL,
237 `config_data` text NOT NULL,
238 PRIMARY KEY (`username`)
240 ENGINE=MyISAM COMMENT='User preferences storage for phpMyAdmin'
241 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;