mkdb 1.0 KB

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. #
  3. # Script to create a table 'FPdev' and to fill it with data.
  4. # The script accepts an optional argument :
  5. # A database to connect to. (default 'testdb')
  6. echo -n "Creating and filling table FPdev in database ${1-testdb}..."
  7. mysql ${1-testdb} << EOF >/dev/null
  8. create table FPdev (
  9. id INT NOT NULL,
  10. UserName CHAR(255),
  11. InstEmail CHAR(255),
  12. PRIMARY KEY (id),
  13. INDEX (id) );
  14. insert into FPdev values ('1','Michael Van Canneyt','[email protected]');
  15. insert into FPdev values ('2','Florian Klaempfl','[email protected]');
  16. insert into FPdev values ('3','Carl-Eric Codere','[email protected]');
  17. insert into FPdev values ('4','Daniel Mantione','[email protected]');
  18. insert into FPdev values ('5','Pierre Muller','[email protected]');
  19. insert into FPdev values ('6','Jonas Maebe','[email protected]');
  20. insert into FPdev values ('7','Peter Vreman','[email protected]');
  21. insert into FPdev values ('8','Gerry Dubois','[email protected]');
  22. EOF
  23. if [ ! $? = 0 ]; then
  24. echo "Failed."
  25. else
  26. echo "Done."
  27. fi
  28. # Ready