问答详情
源自:3-4 JdbcRealm讲解

那几张建表语句能不能共享下?感谢

求个建表语句

提问者:慕容8287587 2018-07-14 11:25

个回答

  • Toconscience
    2018-07-14 17:44:54
    已采纳


    ```

    --

    -- Table structure for table `roles_permissions`

    --


    DROP TABLE IF EXISTS `roles_permissions`;


    CREATE TABLE `roles_permissions` (

      `id` int(11) NOT NULL AUTO_INCREMENT,

      `role_name` varchar(255) DEFAULT NULL,

      `permission` varchar(255) NOT NULL,

      PRIMARY KEY (`id`)

    ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;



    --

    -- Dumping data for table `roles_permissions`

    --


    LOCK TABLES `roles_permissions` WRITE;


    INSERT INTO `roles_permissions` VALUES (1,'admin','user:select'),(2,'admin','user:delete'),(3,'user','user:select');


    UNLOCK TABLES;


    --

    -- Table structure for table `test_user`

    --


    DROP TABLE IF EXISTS `test_user`;


    CREATE TABLE `test_user` (

      `id` int(11) NOT NULL AUTO_INCREMENT,

      `user_name` varchar(255) NOT NULL,

      `password` varchar(255) NOT NULL,

      PRIMARY KEY (`id`)

    ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;



    --

    -- Dumping data for table `test_user`

    --


    LOCK TABLES `test_user` WRITE;


    INSERT INTO `test_user` VALUES (1,'xiaoming','654321');


    UNLOCK TABLES;


    --

    -- Table structure for table `user_roles`

    --


    DROP TABLE IF EXISTS `user_roles`;


    CREATE TABLE `user_roles` (

      `id` int(11) NOT NULL AUTO_INCREMENT,

      `username` varchar(255) DEFAULT NULL,

      `role_name` varchar(255) DEFAULT NULL,

      PRIMARY KEY (`id`)

    ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;



    --

    -- Dumping data for table `user_roles`

    --


    LOCK TABLES `user_roles` WRITE;


    INSERT INTO `user_roles` VALUES (1,'Mark','admin'),(2,'Mark','user');


    UNLOCK TABLES;


    --

    -- Table structure for table `users`

    --


    DROP TABLE IF EXISTS `users`;


    CREATE TABLE `users` (

      `id` int(11) NOT NULL AUTO_INCREMENT,

      `username` varchar(255) DEFAULT NULL,

      `password` varchar(255) DEFAULT NULL,

      PRIMARY KEY (`id`)

    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;



    --

    -- Dumping data for table `users`

    --


    LOCK TABLES `users` WRITE;


    INSERT INTO `users` VALUES (1,'Mark','283538989cef48f3d7d8a1c1bdf2008f');


    UNLOCK TABLES;


    ```

  • 慕移动9181930
    2022-03-26 00:27:18

    被自己蠢哭了onclick()放错位置了firebug

  • weibo_花露晨曦_0
    2020-02-28 11:37:17

    十分感谢

  • 莫槑
    2019-04-21 15:45:29

    这个建表语句是写在哪里呀?MySQL里还是IDEA里面?

  • 慕仔0092249
    2019-02-24 16:47:39

    知道了  十分感谢


  • 革凡
    2019-01-14 15:40:49

    谢谢啦