2020-12-21 23:58:41 +08:00
|
|
|
CREATE DATABASE IF NOT EXISTS seaweedfs;
|
|
|
|
CREATE USER IF NOT EXISTS 'seaweedfs'@'%' IDENTIFIED BY 'secret';
|
2022-05-23 21:53:35 +08:00
|
|
|
GRANT ALL PRIVILEGES ON seaweedfs.* TO 'seaweedfs'@'%';
|
2020-12-21 23:58:41 +08:00
|
|
|
FLUSH PRIVILEGES;
|
|
|
|
USE seaweedfs;
|
2023-01-01 21:07:53 +08:00
|
|
|
CREATE TABLE IF NOT EXISTS `filemeta` (
|
|
|
|
`dirhash` BIGINT NOT NULL COMMENT 'first 64 bits of MD5 hash value of directory field',
|
|
|
|
`name` VARCHAR(766) NOT NULL COMMENT 'directory or file name',
|
|
|
|
`directory` TEXT NOT NULL COMMENT 'full path to parent directory',
|
|
|
|
`meta` LONGBLOB,
|
|
|
|
PRIMARY KEY (`dirhash`, `name`)
|
|
|
|
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
|