mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
3001ec2967
into pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint mysql-test/mysql-test-run.pl: Auto merged scripts/mysql_install_db.sh: Auto merged scripts/mysql_system_tables.sql: Manual merge scripts/mysql_system_tables_data.sql: Manual merge
21 lines
1.3 KiB
SQL
21 lines
1.3 KiB
SQL
--
|
|
-- The inital data for system tables of MySQL Server
|
|
--
|
|
|
|
-- 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;
|
|
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');
|
|
INSERT INTO db SELECT * FROM tmp_db WHERE @had_db_table=0;
|
|
DROP TABLE tmp_db;
|
|
|
|
|
|
-- 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;
|
|
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','','','','',0,0,0,0);
|
|
REPLACE INTO tmp_user VALUES (@@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','','','','',0,0,0,0);
|
|
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','','','','',0,0,0,0);
|
|
INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0;
|
|
DROP TABLE tmp_user;
|