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.

52 lines
1.7 KiB

  1. MySQL database "literature", table "groups"
  2. ===========================================
  3. field names
  4. -----------
  5. fields available in table "groups" description
  6. ---------------------------------- -----------
  7. group_id the unique ID number of this group entry
  8. group_name the display name of this group as it occurs within the groups popup in the user management interface
  9. order_by a string that specifies the primary sort order for this entry (secondary sort order is by group name)
  10. column types
  11. ------------
  12. group_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
  13. group_name VARCHAR(100)
  14. order_by VARCHAR(25)
  15. INDEX (group_name)
  16. table creation code
  17. -------------------
  18. CREATE TABLE groups (group_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, group_name VARCHAR(100), order_by VARCHAR(25), INDEX (group_name));
  19. rules for data import
  20. ---------------------
  21. - fields are separated by tabs, records are separated by returns (if not specified otherwise within the LOAD DATA statement)
  22. - order of fields must resemble the above field order!
  23. - DATE format must be YYYY-MM-DD
  24. - TIME format must be HH:MM:SS
  25. - carriage returns *within* fields (ASCII character 11) must be replaced with a "UNIX return" (ASCII character 10) -> Search for: (\x0B) Replace with: \\n
  26. - empty fields are indicated by \N -> Search for: (?<=\t|^)(?=\t|$) Replace with: \\N
  27. - character encoding: higher ASCII chars must be encoded as ISO-8859-1
  28. - file encoding must be UNIX
  29. load data code
  30. --------------
  31. LOAD DATA LOCAL INFILE "/PATH/TO/FILE/groups.txt" INTO TABLE groups;
  32. or, alternatively, use something like the following from your shell:
  33. mysqlimport --local -u root -p YOUR_DB_NAME "/PATH/TO/FILE/groups.txt"