導出命令:mysql
mysqldump -u username -p databasename > /usr/local/xxx.sql
導入命令sql
mysqldump -u username -p databasename < /usr/local/xxx.sql
注:須要在要移植到的數據庫上建立與將要移植的數據庫相同的數據庫名。數據庫
建立數據庫步驟以下:bash
一、建立用戶ide
--修改管理庫spa
mysq> use mysql mysql>grant all privileges on *.* to dbusername@localhost identified by 'dbuserpassword'; mysql>flush privileges; mysql>grant all privileges on *.* to dbusername@'%' identified by 'dbuserpassword'; mysql>flush privileges;
二、建立數據庫it
create database databasename;