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
16 -- --------------------------------------------------------
19 -- Database : `phpmyadmin`
21 CREATE DATABASE IF NOT EXISTS `phpmyadmin`
22 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
25 -- --------------------------------------------------------
30 -- (activate this statement if necessary)
31 -- GRANT SELECT, INSERT, DELETE, UPDATE ON `phpmyadmin`.* TO
34 -- --------------------------------------------------------
37 -- Table structure for table `pma_bookmark`
40 CREATE TABLE IF NOT EXISTS `pma_bookmark` (
41 `id` int(11) NOT NULL auto_increment,
42 `dbase` varchar(255) NOT NULL default '',
43 `user` varchar(255) NOT NULL default '',
44 `label` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default '',
45 `query` text NOT NULL,
48 ENGINE=MyISAM COMMENT='Bookmarks'
49 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
51 -- --------------------------------------------------------
54 -- Table structure for table `pma_column_info`
57 CREATE TABLE IF NOT EXISTS `pma_column_info` (
58 `id` int(5) unsigned NOT NULL auto_increment,
59 `db_name` varchar(64) NOT NULL default '',
60 `table_name` varchar(64) NOT NULL default '',
61 `column_name` varchar(64) NOT NULL default '',
62 `comment` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default '',
63 `mimetype` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default '',
64 `transformation` varchar(255) NOT NULL default '',
65 `transformation_options` varchar(255) NOT NULL default '',
67 UNIQUE KEY `db_name` (`db_name`,`table_name`,`column_name`)
69 ENGINE=MyISAM COMMENT='Column information for phpMyAdmin'
70 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
72 -- --------------------------------------------------------
75 -- Table structure for table `pma_history`
78 CREATE TABLE IF NOT EXISTS `pma_history` (
79 `id` bigint(20) unsigned NOT NULL auto_increment,
80 `username` varchar(64) NOT NULL default '',
81 `db` varchar(64) NOT NULL default '',
82 `table` varchar(64) NOT NULL default '',
83 `timevalue` timestamp NOT NULL,
84 `sqlquery` text NOT NULL,
86 KEY `username` (`username`,`db`,`table`,`timevalue`)
88 ENGINE=MyISAM COMMENT='SQL history for phpMyAdmin'
89 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
91 -- --------------------------------------------------------
94 -- Table structure for table `pma_pdf_pages`
97 CREATE TABLE IF NOT EXISTS `pma_pdf_pages` (
98 `db_name` varchar(64) NOT NULL default '',
99 `page_nr` int(10) unsigned NOT NULL auto_increment,
100 `page_descr` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default '',
101 PRIMARY KEY (`page_nr`),
102 KEY `db_name` (`db_name`)
104 ENGINE=MyISAM COMMENT='PDF relation pages for phpMyAdmin'
105 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
107 -- --------------------------------------------------------
110 -- Table structure for table `pma_relation`
113 CREATE TABLE IF NOT EXISTS `pma_relation` (
114 `master_db` varchar(64) NOT NULL default '',
115 `master_table` varchar(64) NOT NULL default '',
116 `master_field` varchar(64) NOT NULL default '',
117 `foreign_db` varchar(64) NOT NULL default '',
118 `foreign_table` varchar(64) NOT NULL default '',
119 `foreign_field` varchar(64) NOT NULL default '',
120 PRIMARY KEY (`master_db`,`master_table`,`master_field`),
121 KEY `foreign_field` (`foreign_db`,`foreign_table`)
123 ENGINE=MyISAM COMMENT='Relation table'
124 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
126 -- --------------------------------------------------------
129 -- Table structure for table `pma_table_coords`
132 CREATE TABLE IF NOT EXISTS `pma_table_coords` (
133 `db_name` varchar(64) NOT NULL default '',
134 `table_name` varchar(64) NOT NULL default '',
135 `pdf_page_number` int(11) NOT NULL default '0',
136 `x` float unsigned NOT NULL default '0',
137 `y` float unsigned NOT NULL default '0',
138 PRIMARY KEY (`db_name`,`table_name`,`pdf_page_number`)
140 ENGINE=MyISAM COMMENT='Table coordinates for phpMyAdmin PDF output'
141 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
143 -- --------------------------------------------------------
146 -- Table structure for table `pma_table_info`
149 CREATE TABLE IF NOT EXISTS `pma_table_info` (
150 `db_name` varchar(64) NOT NULL default '',
151 `table_name` varchar(64) NOT NULL default '',
152 `display_field` varchar(64) NOT NULL default '',
153 PRIMARY KEY (`db_name`,`table_name`)
155 ENGINE=MyISAM COMMENT='Table information for phpMyAdmin'
156 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
158 -- --------------------------------------------------------
161 -- Table structure for table `pma_designer_coords`
164 CREATE TABLE IF NOT EXISTS `pma_designer_coords` (
165 `db_name` varchar(64) NOT NULL default '',
166 `table_name` varchar(64) NOT NULL default '',
171 PRIMARY KEY (`db_name`,`table_name`)
173 ENGINE=MyISAM COMMENT='Table coordinates for Designer'
174 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
176 -- --------------------------------------------------------
179 -- Table structure for table `pma_tracking`
182 CREATE TABLE IF NOT EXISTS `pma_tracking` (
183 `db_name` varchar(64) collate utf8_bin NOT NULL,
184 `table_name` varchar(64) collate utf8_bin NOT NULL,
185 `version` int(10) unsigned NOT NULL,
186 `date_created` datetime NOT NULL,
187 `date_updated` datetime NOT NULL,
188 `schema_snapshot` text collate utf8_bin NOT NULL,
189 `schema_sql` text collate utf8_bin,
190 `data_sql` longtext collate utf8_bin,
191 `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') collate utf8_bin default NULL,
192 `tracking_active` int(1) unsigned NOT NULL default '1',
193 PRIMARY KEY (`db_name`,`table_name`,`version`)
194 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=COMPACT;
196 -- --------------------------------------------------------
199 -- Table structure for table `pma_userconfig`
202 CREATE TABLE IF NOT EXISTS `pma_userconfig` (
203 `username` varchar(64) NOT NULL,
204 `timevalue` timestamp NOT NULL,
205 `config_data` text NOT NULL,
206 PRIMARY KEY (`username`)
208 ENGINE=MyISAM COMMENT='User preferences storage for phpMyAdmin'
209 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;