1 -- --------------------------------------------------------
2 -- SQL Commands to set up the pmadb as described in the documentation.
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, ALTER 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,
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 '',
65 `input_transformation` varchar(255) NOT NULL default '',
66 `input_transformation_options` varchar(255) NOT NULL default '',
68 UNIQUE KEY `db_name` (`db_name`,`table_name`,`column_name`)
70 COMMENT='Column information for phpMyAdmin'
71 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
73 -- --------------------------------------------------------
76 -- Table structure for table `pma__history`
79 CREATE TABLE IF NOT EXISTS `pma__history` (
80 `id` bigint(20) unsigned NOT NULL auto_increment,
81 `username` varchar(64) NOT NULL default '',
82 `db` varchar(64) NOT NULL default '',
83 `table` varchar(64) NOT NULL default '',
84 `timevalue` timestamp NOT NULL default CURRENT_TIMESTAMP,
85 `sqlquery` text NOT NULL,
87 KEY `username` (`username`,`db`,`table`,`timevalue`)
89 COMMENT='SQL history for phpMyAdmin'
90 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
92 -- --------------------------------------------------------
95 -- Table structure for table `pma__pdf_pages`
98 CREATE TABLE IF NOT EXISTS `pma__pdf_pages` (
99 `db_name` varchar(64) NOT NULL default '',
100 `page_nr` int(10) unsigned NOT NULL auto_increment,
101 `page_descr` varchar(50) COLLATE utf8_general_ci NOT NULL default '',
102 PRIMARY KEY (`page_nr`),
103 KEY `db_name` (`db_name`)
105 COMMENT='PDF relation pages for phpMyAdmin'
106 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
108 -- --------------------------------------------------------
111 -- Table structure for table `pma__recent`
114 CREATE TABLE IF NOT EXISTS `pma__recent` (
115 `username` varchar(64) NOT NULL,
116 `tables` text NOT NULL,
117 PRIMARY KEY (`username`)
119 COMMENT='Recently accessed tables'
120 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
122 -- --------------------------------------------------------
125 -- Table structure for table `pma__favorite`
128 CREATE TABLE IF NOT EXISTS `pma__favorite` (
129 `username` varchar(64) NOT NULL,
130 `tables` text NOT NULL,
131 PRIMARY KEY (`username`)
133 COMMENT='Favorite tables'
134 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
136 -- --------------------------------------------------------
139 -- Table structure for table `pma__table_uiprefs`
142 CREATE TABLE IF NOT EXISTS `pma__table_uiprefs` (
143 `username` varchar(64) NOT NULL,
144 `db_name` varchar(64) NOT NULL,
145 `table_name` varchar(64) NOT NULL,
146 `prefs` text NOT NULL,
147 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
148 PRIMARY KEY (`username`,`db_name`,`table_name`)
150 COMMENT='Tables'' UI preferences'
151 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
153 -- --------------------------------------------------------
156 -- Table structure for table `pma__relation`
159 CREATE TABLE IF NOT EXISTS `pma__relation` (
160 `master_db` varchar(64) NOT NULL default '',
161 `master_table` varchar(64) NOT NULL default '',
162 `master_field` varchar(64) NOT NULL default '',
163 `foreign_db` varchar(64) NOT NULL default '',
164 `foreign_table` varchar(64) NOT NULL default '',
165 `foreign_field` varchar(64) NOT NULL default '',
166 PRIMARY KEY (`master_db`,`master_table`,`master_field`),
167 KEY `foreign_field` (`foreign_db`,`foreign_table`)
169 COMMENT='Relation table'
170 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
172 -- --------------------------------------------------------
175 -- Table structure for table `pma__table_coords`
178 CREATE TABLE IF NOT EXISTS `pma__table_coords` (
179 `db_name` varchar(64) NOT NULL default '',
180 `table_name` varchar(64) NOT NULL default '',
181 `pdf_page_number` int(11) NOT NULL default '0',
182 `x` float unsigned NOT NULL default '0',
183 `y` float unsigned NOT NULL default '0',
184 PRIMARY KEY (`db_name`,`table_name`,`pdf_page_number`)
186 COMMENT='Table coordinates for phpMyAdmin PDF output'
187 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
189 -- --------------------------------------------------------
192 -- Table structure for table `pma__table_info`
195 CREATE TABLE IF NOT EXISTS `pma__table_info` (
196 `db_name` varchar(64) NOT NULL default '',
197 `table_name` varchar(64) NOT NULL default '',
198 `display_field` varchar(64) NOT NULL default '',
199 PRIMARY KEY (`db_name`,`table_name`)
201 COMMENT='Table information for phpMyAdmin'
202 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
204 -- --------------------------------------------------------
207 -- Table structure for table `pma__tracking`
210 CREATE TABLE IF NOT EXISTS `pma__tracking` (
211 `db_name` varchar(64) NOT NULL,
212 `table_name` varchar(64) NOT NULL,
213 `version` int(10) unsigned NOT NULL,
214 `date_created` datetime NOT NULL,
215 `date_updated` datetime NOT NULL,
216 `schema_snapshot` text NOT NULL,
219 `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,
220 `tracking_active` int(1) unsigned NOT NULL default '1',
221 PRIMARY KEY (`db_name`,`table_name`,`version`)
223 COMMENT='Database changes tracking for phpMyAdmin'
224 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
226 -- --------------------------------------------------------
229 -- Table structure for table `pma__userconfig`
232 CREATE TABLE IF NOT EXISTS `pma__userconfig` (
233 `username` varchar(64) NOT NULL,
234 `timevalue` timestamp NOT NULL default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
235 `config_data` text NOT NULL,
236 PRIMARY KEY (`username`)
238 COMMENT='User preferences storage for phpMyAdmin'
239 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
241 -- --------------------------------------------------------
244 -- Table structure for table `pma__users`
247 CREATE TABLE IF NOT EXISTS `pma__users` (
248 `username` varchar(64) NOT NULL,
249 `usergroup` varchar(64) NOT NULL,
250 PRIMARY KEY (`username`,`usergroup`)
252 COMMENT='Users and their assignments to user groups'
253 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
255 -- --------------------------------------------------------
258 -- Table structure for table `pma__usergroups`
261 CREATE TABLE IF NOT EXISTS `pma__usergroups` (
262 `usergroup` varchar(64) NOT NULL,
263 `tab` varchar(64) NOT NULL,
264 `allowed` enum('Y','N') NOT NULL DEFAULT 'N',
265 PRIMARY KEY (`usergroup`,`tab`,`allowed`)
267 COMMENT='User groups with configured menu items'
268 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
270 -- --------------------------------------------------------
273 -- Table structure for table `pma__navigationhiding`
276 CREATE TABLE IF NOT EXISTS `pma__navigationhiding` (
277 `username` varchar(64) NOT NULL,
278 `item_name` varchar(64) NOT NULL,
279 `item_type` varchar(64) NOT NULL,
280 `db_name` varchar(64) NOT NULL,
281 `table_name` varchar(64) NOT NULL,
282 PRIMARY KEY (`username`,`item_name`,`item_type`,`db_name`,`table_name`)
284 COMMENT='Hidden items of navigation tree'
285 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
287 -- --------------------------------------------------------
290 -- Table structure for table `pma__savedsearches`
293 CREATE TABLE IF NOT EXISTS `pma__savedsearches` (
294 `id` int(5) unsigned NOT NULL auto_increment,
295 `username` varchar(64) NOT NULL default '',
296 `db_name` varchar(64) NOT NULL default '',
297 `search_name` varchar(64) NOT NULL default '',
298 `search_data` text NOT NULL,
300 UNIQUE KEY `u_savedsearches_username_dbname` (`username`,`db_name`,`search_name`)
302 COMMENT='Saved searches'
303 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
305 -- --------------------------------------------------------
308 -- Table structure for table `pma__central_columns`
311 CREATE TABLE IF NOT EXISTS `pma__central_columns` (
312 `db_name` varchar(64) NOT NULL,
313 `col_name` varchar(64) NOT NULL,
314 `col_type` varchar(64) NOT NULL,
316 `col_collation` varchar(64) NOT NULL,
317 `col_isNull` boolean NOT NULL,
318 `col_extra` varchar(255) default '',
320 PRIMARY KEY (`db_name`,`col_name`)
322 COMMENT='Central list of columns'
323 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
325 -- --------------------------------------------------------
328 -- Table structure for table `pma__designer_settings`
331 CREATE TABLE IF NOT EXISTS `pma__designer_settings` (
332 `username` varchar(64) NOT NULL,
333 `settings_data` text NOT NULL,
334 PRIMARY KEY (`username`)
336 COMMENT='Settings related to Designer'
337 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
339 -- --------------------------------------------------------
342 -- Table structure for table `pma__export_templates`
345 CREATE TABLE IF NOT EXISTS `pma__export_templates` (
346 `id` int(5) unsigned NOT NULL AUTO_INCREMENT,
347 `username` varchar(64) NOT NULL,
348 `export_type` varchar(10) NOT NULL,
349 `template_name` varchar(64) NOT NULL,
350 `template_data` text NOT NULL,
352 UNIQUE KEY `u_user_type_template` (`username`,`export_type`,`template_name`)
354 COMMENT='Saved export templates'
355 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;