home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 March (DVD) / PCWorld_2008-03_DVD.iso / komunikace / mysql / mysql-essential-5.0.45-win32.msi / product.cab / file973 < prev    next >
Encoding:
Text File  |  2007-07-06  |  1.3 KB  |  22 lines

  1. --
  2. -- The inital data for system tables of MySQL Server
  3. --
  4.  
  5. -- Fill "db" table with default grants for anyone to
  6. -- access database 'test' and 'test_%' if "db" table didn't exist
  7. CREATE TEMPORARY TABLE tmp_db LIKE db;
  8. INSERT INTO tmp_db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N');
  9. INSERT INTO tmp_db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N');
  10. INSERT INTO db SELECT * FROM tmp_db WHERE @had_db_table=0;
  11. DROP TABLE tmp_db;
  12.  
  13.  
  14. -- Fill "users" table with default users allowing root access
  15. -- from local machine if "users" table didn't exist before
  16. CREATE TEMPORARY TABLE tmp_user LIKE user;
  17. 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','','','','',0,0,0,0);
  18. 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','','','','',0,0,0,0);
  19. 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','','','','',0,0,0,0);
  20. INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0;
  21. DROP TABLE tmp_user;
  22.