創(chuàng)建用戶并授權(quán):
--首先是用root 登陸系統(tǒng)?
create user ‘zhongxiaohong’@‘localhost' identified by 'zhongxiaohong';
?create user 'zhongxiaohong'@'%' identified by 'zhongxiaohong';
?create database product DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
grant all privileges on `product`.* to 'zhongxiaohong'@'localhost' identified by 'zhongxiaohong' with grant option;
grant all privileges on `product`.* to 'zhongxiaohong'@'%' identified by 'zhongxiaohong' with grant option;
導(dǎo)出整個(gè)數(shù)據(jù)庫(kù):
mysqldump -h localhost -uroot -p123456?database > dump.sql
導(dǎo)入整個(gè)數(shù)據(jù)庫(kù):
mysql -uroot -pEnter Password:?>
> source ~/business_db.sql