In mysql, The enum and set types in mysql are both string type and can only be set in the specified set. The difference is that set can take multiple values, enum can only take one SQL code CREATE TABLE '192 _ t' ('id' int (11) NOT NULL AUTO_INCREMENT, 'name' varchar (20) NOT NULL, 'cl' set ('x', 'w', 'R') not null, 'c2 'enum ('F', 'D') not null, primary key ('id') ENGINE = InnoDB www.2cto.com insert into 20121101_t values(null,'a.txt ', 'r, W', 'D'); insert into 2012110t t comment', 'r, w', 'f '); For example, add the execution permission to the B .txt file. SQL code update 20121101_t set cl = cl | 1 where id = 2 1 is because the x permission is applied to the first file. For example, remove the write permission from the B .txt file. SQL code update 2012110t t set cl = cl &~ 2 where id = 2 then look at the SQL code select * from 2012110t T 1 a.txt w, r d 2 B .txt x, r f can follow the chmod usage in linux, directly use a number to indicate the permissions. For example, convert B .txt to the read-only SQL code update 2012110t t set cl = 4 where id = 2. For example, you need to find all the SQL code select * from 20121101_t where cl & 4 www.2cto.com or SQL code select * from 2012110t t where FIND_IN_SET ('R ', cl)> 0 enumis relatively simple, such as changing a.txt from a folder to a file SQL code update 201211020.t set c2 = 'F' where id = 1