Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. use Schema43;
  2.  
  3. LOAD DATA local infile '/Users/mac/Desktop/publisher.txt' INTO TABLE publisher FIELDS TERMINATED BY ',' LINES STARTING BY 'xxx';
  4. LOAD DATA local infile '/Users/mac/Desktop/borrower.txt' INTO TABLE borrower FIELDS TERMINATED BY ',' LINES STARTING BY 'xxx';
  5. LOAD DATA local infile '/Users/mac/Desktop/LIBRARY_BRANCH.txt' INTO TABLE library_branch FIELDS TERMINATED BY ',' LINES STARTING BY 'xxx';
  6. LOAD DATA local infile '/Users/mac/Desktop/BOOK.txt' INTO TABLE book FIELDS TERMINATED BY ',' LINES STARTING BY 'xxx';
  7. LOAD DATA local infile '/Users/mac/Desktop/BOOK_AUTHORS.txt' INTO TABLE bookAuthor FIELDS TERMINATED BY ',' LINES STARTING BY 'xxx';
  8. LOAD DATA local infile '/Users/mac/Desktop/BOOK_COPIES.txt' INTO TABLE book_copies FIELDS TERMINATED BY ',' LINES STARTING BY 'xxx';
  9. LOAD DATA local infile '/Users/mac/Desktop/BOOK_LOANS.txt' INTO TABLE bookloans FIELDS TERMINATED BY ',' LINES STARTING BY 'xxx';
  10.  
  11. SELECT table_schema as `Schema43`,
  12. table_name AS `publisher`,
  13. round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
  14. FROM information_schema.TABLES
  15. WHERE (TABLE_SCHEMA = "Schema43")
  16. ORDER BY (data_length + index_length) DESC;
  17.  
  18.  
  19. optimize table publisher;
  20. optimize table borrower;
  21. optimize table library_branch;
  22. optimize table book;
  23. optimize table bookAuthor;
  24. optimize table book_copies;
  25. optimize table bookloans;
  26.  
  27. SELECT table_schema as `Schema43`,
  28. table_name AS `publisher`,
  29. round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
  30. FROM information_schema.TABLES
  31. WHERE (TABLE_SCHEMA = "Schema43")
  32. ORDER BY (data_length + index_length) DESC;
  33.  
  34. grant all privileges on *.* to 'HR'@'%%' identified by 'engineerOMAR2019';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement