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 PRIMARY KEY (`username`,`db_name`,`table_name`)
133 ENGINE=MyISAM COMMENT='Tables'' UI preferences'
134 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
136 -- --------------------------------------------------------
139 -- Table structure for table `pma_relation`
142 CREATE TABLE IF NOT EXISTS `pma_relation` (
143 `master_db` varchar(64) NOT NULL default '',
144 `master_table` varchar(64) NOT NULL default '',
145 `master_field` varchar(64) NOT NULL default '',
146 `foreign_db` varchar(64) NOT NULL default '',
147 `foreign_table` varchar(64) NOT NULL default '',
148 `foreign_field` varchar(64) NOT NULL default '',
149 PRIMARY KEY (`master_db`,`master_table`,`master_field`),
150 KEY `foreign_field` (`foreign_db`,`foreign_table`)
152 ENGINE=MyISAM COMMENT='Relation table'
153 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
155 -- --------------------------------------------------------
158 -- Table structure for table `pma_table_coords`
161 CREATE TABLE IF NOT EXISTS `pma_table_coords` (
162 `db_name` varchar(64) NOT NULL default '',
163 `table_name` varchar(64) NOT NULL default '',
164 `pdf_page_number` int(11) NOT NULL default '0',
165 `x` float unsigned NOT NULL default '0',
166 `y` float unsigned NOT NULL default '0',
167 PRIMARY KEY (`db_name`,`table_name`,`pdf_page_number`)
169 ENGINE=MyISAM COMMENT='Table coordinates for phpMyAdmin PDF output'
170 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
172 -- --------------------------------------------------------
175 -- Table structure for table `pma_table_info`
178 CREATE TABLE IF NOT EXISTS `pma_table_info` (
179 `db_name` varchar(64) NOT NULL default '',
180 `table_name` varchar(64) NOT NULL default '',
181 `display_field` varchar(64) NOT NULL default '',
182 PRIMARY KEY (`db_name`,`table_name`)
184 ENGINE=MyISAM COMMENT='Table information for phpMyAdmin'
185 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
187 -- --------------------------------------------------------
190 -- Table structure for table `pma_designer_coords`
193 CREATE TABLE IF NOT EXISTS `pma_designer_coords` (
194 `db_name` varchar(64) NOT NULL default '',
195 `table_name` varchar(64) NOT NULL default '',
200 PRIMARY KEY (`db_name`,`table_name`)
202 ENGINE=MyISAM COMMENT='Table coordinates for Designer'
203 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
205 -- --------------------------------------------------------
208 -- Table structure for table `pma_tracking`
211 CREATE TABLE IF NOT EXISTS `pma_tracking` (
212 `db_name` varchar(64) NOT NULL,
213 `table_name` varchar(64) NOT NULL,
214 `version` int(10) unsigned NOT NULL,
215 `date_created` datetime NOT NULL,
216 `date_updated` datetime NOT NULL,
217 `schema_snapshot` text NOT NULL,
220 `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,
221 `tracking_active` int(1) unsigned NOT NULL default '1',
222 PRIMARY KEY (`db_name`,`table_name`,`version`)
224 ENGINE=MyISAM ROW_FORMAT=COMPACT COMMENT='Database changes tracking for phpMyAdmin'
225 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
227 -- --------------------------------------------------------
230 -- Table structure for table `pma_userconfig`
233 CREATE TABLE IF NOT EXISTS `pma_userconfig` (
234 `username` varchar(64) NOT NULL,
235 `timevalue` timestamp NOT NULL,
236 `config_data` text NOT NULL,
237 PRIMARY KEY (`username`)
239 ENGINE=MyISAM COMMENT='User preferences storage for phpMyAdmin'
240 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;