You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.7 KiB

  1. MySQL database "literature", table "auth"
  2. =========================================
  3. field names
  4. -----------
  5. fields available in table "auth" description
  6. -------------------------------- -----------
  7. user_id the user's unique ID number (which corresponds to the user_id number of the user's record entry within the "users" table)
  8. email the user's email address at work (required!) -> needed for logging into the database (must be unique among all users!)
  9. password the user's password (required!) -> needed for logging into the database
  10. column types
  11. ------------
  12. user_id MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY
  13. email VARCHAR(50) NOT NULL
  14. password VARCHAR(15) NOT NULL
  15. table creation code
  16. -------------------
  17. CREATE TABLE auth (user_id MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, email VARCHAR(50) NOT NULL, password VARCHAR(15) NOT NULL);
  18. rules for data import
  19. ---------------------
  20. - fields are separated by tabs, records are separated by returns (if not specified otherwise within the LOAD DATA statement)
  21. - order of fields must resemble the above field order!
  22. - DATE format must be YYYY-MM-DD
  23. - TIME format must be HH:MM:SS
  24. - carriage returns *within* fields (ASCII character 11) must be replaced with a "UNIX return" (ASCII character 10) -> Search for: (\x0B) Replace with: \\n
  25. - empty fields are indicated by \N -> Search for: (?<=\t|^)(?=\t|$) Replace with: \\N
  26. - character encoding: higher ASCII chars must be encoded as ISO-8859-1
  27. - file encoding must be UNIX
  28. load data code
  29. --------------
  30. LOAD DATA LOCAL INFILE "/PATH/TO/FILE/auth.txt" INTO TABLE auth;
  31. or, alternatively, use something like the following from your shell:
  32. mysqlimport --local -u root -p YOUR_DB_NAME "/PATH/TO/FILE/auth.txt"