织梦怎么批量修改表前缀(利用sql语句)
安装DedeCMS的时候,数据表前缀默认为dede_,当系统使用了一段时间后,想更改数据表前缀,结果发现不是那么容易。有没有批量修改表前缀的方法?
在phpmyadmin执行如下SQL命令,将表前缀转换
修改好表前缀后,重启一下mysql,还需要修改/DATA/COMMON.INC.PHP文件中的$cfg_dbprefix = 'dede_'。以及对后台中的“频道模型”-->“内容模型管理”中的相应的附加表(
shop_addonarticle
)也做一下修改。
ALTER TABLE dede_addonimages RENAME TO shop_addonimages; ALTER TABLE dede_addoninfos RENAME TO shop_addoninfos; ALTER TABLE dede_admin RENAME TO shop_admin; ALTER TABLE dede_admintype RENAME TO shop_admintype; ALTER TABLE dede_advancedsearch RENAME TO shop_advancedsearch; ALTER TABLE dede_arcatt RENAME TO shop_arcatt; ALTER TABLE dede_arccache RENAME TO shop_arccache; ALTER TABLE dede_archives RENAME TO shop_archives; ALTER TABLE dede_arcmulti RENAME TO shop_arcmulti; ALTER TABLE dede_arcrank RENAME TO shop_arcrank; ALTER TABLE dede_arctiny RENAME TO shop_arctiny; ALTER TABLE dede_arctype RENAME TO shop_arctype; ALTER TABLE dede_area RENAME TO shop_area; ALTER TABLE dede_channeltype RENAME TO shop_channeltype; ALTER TABLE dede_co_htmls RENAME TO shop_co_htmls; ALTER TABLE dede_co_mediaurls RENAME TO shop_co_mediaurls; ALTER TABLE dede_co_note RENAME TO shop_co_note; ALTER TABLE dede_co_onepage RENAME TO shop_co_onepage; ALTER TABLE dede_co_urls RENAME TO shop_co_urls; ALTER TABLE dede_diyforms RENAME TO shop_diyforms; ALTER TABLE dede_downloads RENAME TO shop_downloads; ALTER TABLE dede_erradd RENAME TO shop_erradd; ALTER TABLE dede_feedback RENAME TO shop_feedback; ALTER TABLE dede_flink RENAME TO shop_flink; ALTER TABLE dede_flinktype RENAME TO shop_flinktype; ALTER TABLE dede_freelist RENAME TO shop_freelist; ALTER TABLE dede_homepageset RENAME TO shop_homepageset; ALTER TABLE dede_keywords RENAME TO shop_keywords; ALTER TABLE dede_log RENAME TO shop_log; ALTER TABLE dede_member RENAME TO shop_member; ALTER TABLE dede_member_company RENAME TO shop_member_company; ALTER TABLE dede_member_feed RENAME TO shop_member_feed; ALTER TABLE dede_member_flink RENAME TO shop_member_flink; ALTER TABLE dede_member_friends RENAME TO shop_member_friends; ALTER TABLE dede_member_group RENAME TO shop_member_group; ALTER TABLE dede_member_guestbook RENAME TO shop_member_guestbook; ALTER TABLE dede_member_model RENAME TO shop_member_model; ALTER TABLE dede_member_msg RENAME TO shop_member_msg; ALTER TABLE dede_member_operation RENAME TO shop_member_operation; ALTER TABLE dede_member_person RENAME TO shop_member_person; ALTER TABLE dede_member_pms RENAME TO shop_member_pms; ALTER TABLE dede_member_snsmsg RENAME TO shop_member_snsmsg; ALTER TABLE dede_member_space RENAME TO shop_member_space; ALTER TABLE dede_member_stow RENAME TO shop_member_stow; ALTER TABLE dede_member_stowtype RENAME TO shop_member_stowtype; ALTER TABLE dede_member_tj RENAME TO shop_member_tj; ALTER TABLE dede_member_type RENAME TO shop_member_type; ALTER TABLE dede_member_vhistory RENAME TO shop_member_vhistory; ALTER TABLE dede_moneycard_record RENAME TO shop_moneycard_record; ALTER TABLE dede_moneycard_type RENAME TO shop_moneycard_type; ALTER TABLE dede_mtypes RENAME TO shop_mtypes; ALTER TABLE dede_multiserv_config RENAME TO shop_multiserv_config; ALTER TABLE dede_myad RENAME TO shop_myad; ALTER TABLE dede_mytag RENAME TO shop_mytag; ALTER TABLE dede_plus RENAME TO shop_plus; ALTER TABLE dede_pwd_tmp RENAME TO shop_pwd_tmp; ALTER TABLE dede_ratings RENAME TO shop_ratings; ALTER TABLE dede_scores RENAME TO shop_scores; ALTER TABLE dede_search_cache RENAME TO shop_search_cache; ALTER TABLE dede_search_keywords RENAME TO shop_search_keywords; ALTER TABLE dede_sgpage RENAME TO shop_sgpage; ALTER TABLE dede_shops_delivery RENAME TO shop_shops_delivery; ALTER TABLE dede_shops_orders RENAME TO shop_shops_orders; ALTER TABLE dede_shops_products RENAME TO shop_shops_products; ALTER TABLE dede_shops_userinfo RENAME TO shop_shops_userinfo; ALTER TABLE dede_softconfig RENAME TO shop_softconfig; ALTER TABLE dede_stepselect RENAME TO shop_stepselect; ALTER TABLE dede_sys_enum RENAME TO shop_sys_enum; ALTER TABLE dede_sys_module RENAME TO shop_sys_module; ALTER TABLE dede_sys_set RENAME TO shop_sys_set; ALTER TABLE dede_sys_task RENAME TO shop_sys_task; ALTER TABLE dede_sysconfig RENAME TO shop_sysconfig; ALTER TABLE dede_tagindex RENAME TO shop_tagindex; ALTER TABLE dede_taglist RENAME TO shop_taglist; ALTER TABLE dede_uploads RENAME TO shop_uploads; ALTER TABLE dede_verifies RENAME TO shop_verifies; ALTER TABLE dede_vote RENAME TO shop_vote; ALTER TABLE dede_addonarticle RENAME TO shop_addonarticle;