NoteOnMe博客平台搭建
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

40 righe
1.2 KiB

  1. GRANT ALL ON blog.* TO 'root'@'%' IDENTIFIED BY 'a15862340183';
  2. CREATE DATABASE blog DEFAULT CHARACTER SET utf8;
  3. CREATE TABLE users (
  4. user_id INT UNSIGNED NOT NULL AUTO_INCREMENT ,
  5. password VARCHAR(128) NOT NULL ,
  6. name VARCHAR(255) NOT NULL ,
  7. PRIMARY KEY(user_id)
  8. )ENGINE=InnoDB DEFAULT CHARSET=utf8;
  9. CREATE TABLE article (
  10. article_id INT UNSIGNED NOT NULL AUTO_INCREMENT ,
  11. user_id INT UNSIGNED NOT NULL,
  12. headline TEXT,
  13. content TEXT,
  14. viewer INT UNSIGNED ,
  15. public varchar(11),
  16. category varchar(128),
  17. PRIMARY KEY(article_id),
  18. CONSTRAINT articc_ibfk_1
  19. FOREIGN KEY (user_id)
  20. REFERENCES users (user_id)
  21. ON DELETE CASCADE ON UPDATE CASCADE
  22. )ENGINE=InnoDB DEFAULT CHARSET=utf8;
  23. CREATE TABLE commentsss (
  24. id INT UNSIGNED NOT NULL AUTO_INCREMENT ,
  25. comment_id INT UNSIGNED NOT NULL,
  26. feedback_id INT UNSIGNED ,
  27. name VARCHAR(128),
  28. user_id INTEGER,
  29. article_id INT UNSIGNED,
  30. content TEXT,
  31. PRIMARY KEY(id),
  32. CONSTRAINT articcc_ibfk_1
  33. FOREIGN KEY (article_id)
  34. REFERENCES article (article_id)
  35. ON DELETE CASCADE ON UPDATE CASCADE
  36. )ENGINE=InnoDB DEFAULT CHARSET=utf8;