CREATE DATABASE test
USE test;
CREATE TABLE test_table (
user_id CHAR(100) NOT NULL,
tel CHAR(11) NOT NULL,
PRIMARY KEY (tel)
);
SHOW COLUMNS FROM test_table;
INSERT INTO test_table (user_id,tel) VALUES("测试0","0");
INSERT INTO test_table VALUES("测试1","1"),("测试2","2");
INSERT INTO test_table SELECT * FROM test_table;
DELETE FROM test_table WHERE user_id='测试0';
SHOW GRANTS FOR test@localhost;
CREATE USER test@localhost IDENTIFIED BY '123';
GRANT ALL ON test.test_table TO test@localhost;
USE test;
GRANT ALL ON test TO 'test'@'localhost';