Skip to content

MySQL MariaDB SQL

tooliload edited this page Jun 22, 2023 · 1 revision

SET NAMES utf8; SET time_zone = '+00:00'; SET foreign_key_checks = 0;

SET NAMES utf8mb4;

DROP TABLE IF EXISTS groups; CREATE TABLE groups ( groupname varchar(30) NOT NULL, gid int(11) NOT NULL, members varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

DROP TABLE IF EXISTS login_history; CREATE TABLE login_history ( userid varchar(30) NOT NULL, client_ip varchar(500) NOT NULL, server_ip varchar(500) NOT NULL, protocol varchar(500) NOT NULL, login_date datetime NOT NULL, KEY user (userid), CONSTRAINT login_history_ibfk_1 FOREIGN KEY (userid) REFERENCES users (userid) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

DROP TABLE IF EXISTS users; CREATE TABLE users ( userid varchar(30) NOT NULL, passwd varchar(80) NOT NULL, uid int(11) DEFAULT NULL, gid int(11) DEFAULT NULL, homedir varchar(255) DEFAULT NULL, shell varchar(255) DEFAULT NULL, last_accessed timestamp NULL DEFAULT NULL, UNIQUE KEY userid (userid), UNIQUE KEY uid (uid) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

Clone this wiki locally