//登錄MYSQL @>mysql -u root -p @>密碼 //創建用戶 mysql> insert into mysql.user(Host,User,Password) values('localhost','tanzuai',password('123456')); //刷新系統權限表 mysql>flush privileges; 這樣就創建了一個名為:tanzuai 密碼為:123456 的用戶。 //退出後登錄一下 mysql>exit; @>mysql -u tanzuai -p @>輸入密碼 mysql>登錄成功
//登錄MYSQL(有ROOT權限)。我裡我以ROOT身份登錄. @>mysql -u root -p @>密碼 //首先為用戶創建一個數據庫(tanzuaidb) mysql>create database tanzuaidb; //授權jeecn用戶擁有jeecn數據庫的所有權限 @>grant all on tanzuaidb.* to tanzuai@localhost identified by '123456'; //刷新系統權限表 mysql>flush privileges; mysql>其它操作 //如果想指定部分權限給一用戶,可以這樣來寫: mysql>grant select,update on tanzuaidb.* to tanzuai@localhost identified by 123456; //刷新系統權限表。 mysql>flush privileges;
@>mysql -u root -p @>密碼 mysql>DELETE FROM user WHERE User=”jeecn” and Host=”localhost”; mysql>flush privileges; //刪除用戶的數據庫 mysql>drop database tanzuaidb;
@>mysql -u root -p @>密碼 mysql>update mysql.user set password=password(‘新密碼’) where User=”tanzuai” and Host=”localhost”; mysql>flush privileges; mysql>quit;
create table receive_user ( waybillno varchar(20) not null check(waybillno!=''), model varchar(20) not null, userid varchar(20) not null, create_time datetime default null, primary key(waybillno) )engine=InnoDB default charset=utf8 auto_increment=1;