更改mysql 数据库名称

//创建新数据库

CREATE DATABASE hbwebTemporary;

 

//移植每个表

RENAME TABLE hbweb.aircraft_info TO hbwebTemporary.aircraft_info
 ,hbweb.airline_info TO hbwebTemporary.airline_info
 ,hbweb.airport_info TO hbwebTemporary.airport_info
 ,hbweb.airport_subinfo TO hbwebTemporary.airport_subinfo
 ,hbweb.airport_subinfotype TO hbwebTemporary.airport_subinfotype
 ,hbweb.airportflow TO hbwebTemporary.airportflow
 ,hbweb.atmb TO hbwebTemporary.atmb
 ,hbweb.authority_import TO hbwebTemporary.authority_import
 ,hbweb.backuphistory TO hbwebTemporary.backuphistory
 ,hbweb.flightplan TO hbwebTemporary.flightplan
 ,hbweb.flightplan_days TO hbwebTemporary.flightplan_days
 ,hbweb.flightplan_differencedata TO hbwebTemporary.flightplan_differencedata
,hbweb.importdbmerger TO hbwebTemporary.importdbmerger
,hbweb.importhistorydb TO hbwebTemporary.importhistorydb
,hbweb.journalmanagement TO hbwebTemporary.journalmanagement
,hbweb.notice TO hbwebTemporary.notice
,hbweb.seasons TO hbwebTemporary.seasons
,hbweb.temporarymerger TO hbwebTemporary.temporarymerger
,hbweb.terminaltimelibrary TO hbwebTemporary.terminaltimelibrary
,hbweb.userpermission TO hbwebTemporary.userpermission
,hbweb.userrole TO hbwebTemporary.userrole
,hbweb.userrole_userpermission TO hbwebTemporary.userrole_userpermission
,hbweb.users TO hbwebTemporary.users
,hbweb.users_password TO hbwebTemporary.users_password
,hbweb.users_userrole TO hbwebTemporary.users_userrole;

//删除原数据库

DROP DATABASE hbwebTemporary;

posted on 2015-12-18 14:35  张晓虹  阅读(712)  评论(0编辑  收藏  举报

导航