2007-02-28 14:26:58 +01:00
|
|
|
--
|
|
|
|
-- The inital data for system tables of MySQL Server
|
|
|
|
--
|
|
|
|
|
2007-11-30 06:14:43 +01:00
|
|
|
-- When setting up a "cross bootstrap" database (e.g., creating data on a Unix
|
|
|
|
-- host which will later be included in a Windows zip file), any lines
|
|
|
|
-- containing "@current_hostname" are filtered out by mysql_install_db.
|
|
|
|
set @current_hostname= @@hostname;
|
|
|
|
|
|
|
|
|
2007-04-12 17:48:28 +02:00
|
|
|
-- Fill "db" table with default grants for anyone to
|
|
|
|
-- access database 'test' and 'test_%' if "db" table didn't exist
|
|
|
|
CREATE TEMPORARY TABLE tmp_db LIKE db;
|
2007-04-13 15:13:12 +02:00
|
|
|
INSERT INTO tmp_db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');
|
|
|
|
INSERT INTO tmp_db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');
|
2007-04-12 17:48:28 +02:00
|
|
|
INSERT INTO db SELECT * FROM tmp_db WHERE @had_db_table=0;
|
|
|
|
DROP TABLE tmp_db;
|
2007-02-28 14:26:58 +01:00
|
|
|
|
|
|
|
|
2007-04-12 17:48:28 +02:00
|
|
|
-- Fill "users" table with default users allowing root access
|
|
|
|
-- from local machine if "users" table didn't exist before
|
|
|
|
CREATE TEMPORARY TABLE tmp_user LIKE user;
|
2007-12-10 12:16:41 +01:00
|
|
|
set @current_hostname= @@hostname;
|
2010-08-09 10:32:50 +02:00
|
|
|
INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','');
|
|
|
|
REPLACE INTO tmp_user SELECT @current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','' FROM dual WHERE LOWER( @current_hostname) != 'localhost';
|
|
|
|
REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','');
|
|
|
|
REPLACE INTO tmp_user VALUES ('::1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0,'','');
|
2007-10-04 11:30:30 +02:00
|
|
|
INSERT INTO tmp_user (host,user) VALUES ('localhost','');
|
2008-09-24 14:59:56 +02:00
|
|
|
INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE LOWER(@current_hostname ) != 'localhost';
|
2007-04-12 17:48:28 +02:00
|
|
|
INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0;
|
|
|
|
DROP TABLE tmp_user;
|
2010-08-09 10:32:50 +02:00
|
|
|
|
|
|
|
CREATE TEMPORARY TABLE tmp_proxy_priv LIKE proxy_priv;
|
|
|
|
INSERT INTO tmp_proxy_priv VALUES ('localhost', 'root', '', '', TRUE);
|
|
|
|
REPLACE INTO tmp_proxy_priv SELECT @current_hostname, 'root', '', '', TRUE FROM DUAL WHERE LOWER (@current_hostname) != 'localhost';
|
|
|
|
INSERT INTO proxy_priv SELECT * FROM tmp_proxy_priv WHERE @had_proxy_priv_table=0;
|
|
|
|
DROP TABLE tmp_proxy_priv;
|