summaryrefslogtreecommitdiff
blob: 147c07f721b84961440846207875df83778d4937 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
GRANT USAGE ON mysql.* TO 'pma'@'localhost' IDENTIFIED BY '@pmapass@';

GRANT SELECT (Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv,
	Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv,
	File_priv, Grant_priv, References_priv, Index_priv, Alter_priv)
	ON mysql.user TO 'pma'@'localhost';

GRANT SELECT ON mysql.db TO 'pma'@'localhost';

GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv)
	ON mysql.tables_priv TO 'pma'@'localhost';

GRANT SELECT, INSERT, UPDATE, DELETE ON pmadb.* TO 'pma'@'localhost';

CREATE DATABASE IF NOT EXISTS pmadb;
USE pmadb;

CREATE TABLE IF NOT EXISTS `PMA_bookmark` (
	`id` int(11) DEFAULT '0' NOT NULL auto_increment,
	`dbase` varchar(255) NOT NULL,
	`user` varchar(255) NOT NULL,
	`label` varchar(255) NOT NULL,
	`query` text NOT NULL,
	PRIMARY KEY (id)
	) TYPE=MyISAM COMMENT='Bookmarks';

CREATE TABLE IF NOT EXISTS `PMA_relation` (
	`master_db` varchar(64) NOT NULL default '',
	`master_table` varchar(64) NOT NULL default '',
	`master_field` varchar(64) NOT NULL default '',
	`foreign_db` varchar(64) NOT NULL default '',
	`foreign_table` varchar(64) NOT NULL default '',
	`foreign_field` varchar(64) NOT NULL default '',
	PRIMARY KEY (`master_db`, `master_table`, `master_field`),
	KEY foreign_field (foreign_db, foreign_table)
	) TYPE=MyISAM COMMENT='Relation table';

CREATE TABLE IF NOT EXISTS `PMA_table_info` (
	`db_name` varchar(64) NOT NULL default '',
	`table_name` varchar(64) NOT NULL default '',
	`display_field` varchar(64) NOT NULL default '',
	PRIMARY KEY (`db_name`, `table_name`)
	) TYPE=MyISAM COMMENT='Table information for phpMyAdmin';

CREATE TABLE IF NOT EXISTS `PMA_table_coords` (
	`db_name` varchar(64) NOT NULL default '',
	`table_name` varchar(64) NOT NULL default '',
	`pdf_page_number` int NOT NULL default '0',
	`x` float unsigned NOT NULL default '0',
	`y` float unsigned NOT NULL default '0',
	PRIMARY KEY (`db_name`, `table_name`, `pdf_page_number`)
	) TYPE=MyISAM COMMENT='Table coordinates for phpMyAdmin PDF output';

CREATE TABLE IF NOT EXISTS `PMA_pdf_pages` (
	`db_name` varchar(64) NOT NULL default '',
	`page_nr` int(10) unsigned NOT NULL auto_increment,
	`page_descr` varchar(50) NOT NULL default '',
	PRIMARY KEY (page_nr),
	KEY (db_name)
	) TYPE=MyISAM COMMENT='PDF Relationpages for PMA';

CREATE TABLE IF NOT EXISTS `PMA_column_info` (
	id int(5) unsigned NOT NULL auto_increment,
	db_name varchar(64) NOT NULL default '',
	table_name varchar(64) NOT NULL default '',
	column_name varchar(64) NOT NULL default '',
	`comment` varchar(255) NOT NULL default '',
	mimetype varchar(255) NOT NULL default '',
	transformation varchar(255) NOT NULL default '',
	transformation_options varchar(255) NOT NULL default '',
	PRIMARY KEY (id),
	UNIQUE KEY db_name (db_name, table_name, column_name)
	) TYPE=MyISAM COMMENT='Comments for Columns';

CREATE TABLE IF NOT EXISTS `PMA_history` (
	`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
	`username` VARCHAR( 64 ) NOT NULL ,
	`db` VARCHAR( 64 ) NOT NULL ,
	`table` VARCHAR( 64 ) NOT NULL ,
	`timevalue` TIMESTAMP NOT NULL ,
	`sqlquery` TEXT NOT NULL ,
	PRIMARY KEY ( `id` ) ,
	INDEX ( `username` , `db` , `table` , `timevalue` )
	) TYPE=MyISAM COMMENT='SQL history';