CONNECT mysql;

INSERT INTO user ( host, user, password )
   VALUES (
      'localhost',
      'schoolboard',
      password( 'school' )
      );

INSERT INTO db (
      host, db, user,
         Select_priv, Insert_priv, Update_priv, Delete_priv,
         Create_priv, Drop_priv )
      VALUES (
      'localhost',
      'schoolboard',
      'schoolboard',
      'Y', 'Y', 'Y', 'Y',
      'Y', 'Y'
        );
        
FLUSH PRIVILEGES;

CREATE DATABASE schoolboard;
CONNECT schoolboard;

#
# Table structure for table 'user_table'
#
CREATE TABLE user_table (
  userid varchar(8) binary DEFAULT '' NOT NULL,
  username varchar(30) DEFAULT '' NOT NULL,
  userpassword varchar(25) binary DEFAULT '' NOT NULL,
  useremail varchar(70) binary DEFAULT '' NOT NULL,
  groups varchar(25) DEFAULT '' NOT NULL,
  PRIMARY KEY (userid)
);

#
# Table structure for table 'demo_board'
#


CREATE TABLE school_board (
  userid varchar(25) binary DEFAULT '' NOT NULL,
  msg_id mediumint(10) DEFAULT '0' NOT NULL,
  msg_subject varchar(200) DEFAULT '' NOT NULL,
  msg_body text NOT NULL,
  msg_hit mediumint(10) DEFAULT '0' NOT NULL,
  msg_date datetime,
  attach varchar(30) DEFAULT '' NOT NULL,
  msg_date_expire datetime,
  PRIMARY KEY (msg_id),
  KEY userid (userid)
);
