首先创建一个数据表Market:create table Market;如下:
CREATE TABLE `orders` (
`o_num` int(11) NOT NULL AUTO_INCREMENT,
`o_date` date DEFAULT NULL,
`c_id` int(11) DEFAULT NULL,
PRIMARY KEY (`o_num`),
KEY `c_id` (`c_id`)
);
ALTER TABLE `Market`.`orders` DROP FOREIGN KEY `orders_ibfk_1`;
CREATE TABLE `player` (
`playid` int(11) NOT NULL,
`playname` varchar(30) NOT NULL,
`teamnum` int(11) NOT NULL,
`info` varchar(50) DEFAULT NULL,
PRIMARY KEY (`playid`),
UNIQUE KEY `teamnum` (`teamnum`)
);
CREATE USER 'jeffrey'@'localhost'
IDENTIFIED BY 'new_password'
mysql> alter user 'account1'@'localhost' identified by 'newpwd2';
mysql> flush privileges;
mysql> show grants for 'account1'@'localhost';
mysql> revoke select,insert,update(info) on Team.player from 'account1'@'localhost';
mysql> drop user 'account1'@'localhost';