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) CHARACTER SET utf8 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) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default '',
62 `mimetype` varchar(255) CHARACTER SET utf8 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) CHARACTER SET utf8 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_relation`
112 CREATE TABLE IF NOT EXISTS `pma_relation` (
113 `master_db` varchar(64) NOT NULL default '',
114 `master_table` varchar(64) NOT NULL default '',
115 `master_field` varchar(64) NOT NULL default '',
116 `foreign_db` varchar(64) NOT NULL default '',
117 `foreign_table` varchar(64) NOT NULL default '',
118 `foreign_field` varchar(64) NOT NULL default '',
119 PRIMARY KEY (`master_db`,`master_table`,`master_field`),
120 KEY `foreign_field` (`foreign_db`,`foreign_table`)
122 ENGINE=MyISAM COMMENT='Relation table'
123 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
125 -- --------------------------------------------------------
128 -- Table structure for table `pma_table_coords`
131 CREATE TABLE IF NOT EXISTS `pma_table_coords` (
132 `db_name` varchar(64) NOT NULL default '',
133 `table_name` varchar(64) NOT NULL default '',
134 `pdf_page_number` int(11) NOT NULL default '0',
135 `x` float unsigned NOT NULL default '0',
136 `y` float unsigned NOT NULL default '0',
137 PRIMARY KEY (`db_name`,`table_name`,`pdf_page_number`)
139 ENGINE=MyISAM COMMENT='Table coordinates for phpMyAdmin PDF output'
140 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
142 -- --------------------------------------------------------
145 -- Table structure for table `pma_table_info`
148 CREATE TABLE IF NOT EXISTS `pma_table_info` (
149 `db_name` varchar(64) NOT NULL default '',
150 `table_name` varchar(64) NOT NULL default '',
151 `display_field` varchar(64) NOT NULL default '',
152 PRIMARY KEY (`db_name`,`table_name`)
154 ENGINE=MyISAM COMMENT='Table information for phpMyAdmin'
155 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
157 -- --------------------------------------------------------
160 -- Table structure for table `pma_designer_coords`
163 CREATE TABLE IF NOT EXISTS `pma_designer_coords` (
164 `db_name` varchar(64) NOT NULL default '',
165 `table_name` varchar(64) NOT NULL default '',
170 PRIMARY KEY (`db_name`,`table_name`)
172 ENGINE=MyISAM COMMENT='Table coordinates for Designer'
173 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
175 -- --------------------------------------------------------
178 -- Table structure for table `pma_tracking`
181 CREATE TABLE IF NOT EXISTS `pma_tracking` (
182 `db_name` varchar(64) collate utf8_bin NOT NULL,
183 `table_name` varchar(64) collate utf8_bin NOT NULL,
184 `version` int(10) unsigned NOT NULL,
185 `date_created` datetime NOT NULL,
186 `date_updated` datetime NOT NULL,
187 `schema_snapshot` text collate utf8_bin NOT NULL,
188 `schema_sql` text collate utf8_bin,
189 `data_sql` longtext collate utf8_bin,
190 `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,
191 `tracking_active` int(1) unsigned NOT NULL default '1',
192 PRIMARY KEY (`db_name`,`table_name`,`version`)
193 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=COMPACT;
195 -- --------------------------------------------------------
198 -- Table structure for table `pma_userconfig`
201 CREATE TABLE IF NOT EXISTS `pma_userconfig` (
202 `username` varchar(64) NOT NULL,
203 `timevalue` timestamp NOT NULL,
204 `config_data` text NOT NULL,
205 PRIMARY KEY (`username`)
207 ENGINE=MyISAM COMMENT='User preferences storage for phpMyAdmin'
208 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;