好多人用dedecms也就是织梦系统来做网站,但是稍微懂点技术的老铁们希望把数据库的表前缀修改了,如果手动一个表一个表的修改太累了,那有没有批量修改的工具或者方法吗?台儿庄伯乐网络今天就带大家来一起学习一下批量修改数据库表前缀的方法
一、首页下载一个Navicat for MySQL数据库管理软件
二、安装好后,进行链接数据库(需要输入服务器IP, 数据库用户名,数据库密码,数据库名称)
三、那我们链接好以后,点击工具里面的“命令列介面”功能,进入mysql代码操作界面
四、在命令框里输入以下sql语句,即可成功修改表前缀
ALTER TABLE dede_addonarticle RENAME TO bole__addonarticle;
ALTER TABLE dede_addonimages RENAME TO bole__addonimages;
ALTER TABLE dede_addoninfos RENAME TO bole__addoninfos;
ALTER TABLE dede_addonshop RENAME TO bole__addonshop;
ALTER TABLE dede_addonsoft RENAME TO bole__addonsoft;
ALTER TABLE dede_addonspec RENAME TO bole__addonspec;
ALTER TABLE dede_admin RENAME TO bole__admin;
ALTER TABLE dede_admintype RENAME TO bole__admintype;
ALTER TABLE dede_advancedsearch RENAME TO bole__advancedsearch;
ALTER TABLE dede_arcatt RENAME TO bole__arcatt;
ALTER TABLE dede_arccache RENAME TO bole__arccache;
ALTER TABLE dede_archives RENAME TO bole__archives;
ALTER TABLE dede_arcmulti RENAME TO bole__arcmulti;
ALTER TABLE dede_arcrank RENAME TO bole__arcrank;
ALTER TABLE dede_arctiny RENAME TO bole__arctiny;
ALTER TABLE dede_arctype RENAME TO bole__arctype;
ALTER TABLE dede_area RENAME TO bole__area;
ALTER TABLE dede_channeltype RENAME TO bole__channeltype;
ALTER TABLE dede_co_htmls RENAME TO bole__co_htmls;
ALTER TABLE dede_co_mediaurls RENAME TO bole__co_mediaurls;
ALTER TABLE dede_co_note RENAME TO bole__co_note;
ALTER TABLE dede_co_onepage RENAME TO bole__co_onepage;
ALTER TABLE dede_co_urls RENAME TO bole__co_urls;
ALTER TABLE dede_diyform1 RENAME TO bole__diyform1;
ALTER TABLE dede_diyforms RENAME TO bole__diyforms;
ALTER TABLE dede_dl_log RENAME TO bole__dl_log;
ALTER TABLE dede_downloads RENAME TO bole__downloads;
ALTER TABLE dede_erradd RENAME TO bole__erradd;
ALTER TABLE dede_feedback RENAME TO bole__feedback;
ALTER TABLE dede_flink RENAME TO bole__flink;
ALTER TABLE dede_flinktype RENAME TO bole__flinktype;
ALTER TABLE dede_freelist RENAME TO bole__freelist;
ALTER TABLE dede_guestbook RENAME TO bole__guestbook;
ALTER TABLE dede_homepageset RENAME TO bole__homepageset;
ALTER TABLE dede_keywords RENAME TO bole__keywords;
ALTER TABLE dede_log RENAME TO bole__log;
ALTER TABLE dede_member RENAME TO bole__member;
ALTER TABLE dede_member_company RENAME TO bole__member_company;
ALTER TABLE dede_member_feed RENAME TO bole__member_feed;
ALTER TABLE dede_member_flink RENAME TO bole__member_flink;
ALTER TABLE dede_member_friends RENAME TO bole__member_friends;
ALTER TABLE dede_member_group RENAME TO bole__member_group;
ALTER TABLE dede_member_guestbook RENAME TO bole__member_guestbook;
ALTER TABLE dede_member_model RENAME TO bole__member_model;
ALTER TABLE dede_member_msg RENAME TO bole__member_msg;
ALTER TABLE dede_member_operation RENAME TO bole__member_operation;
ALTER TABLE dede_member_person RENAME TO bole__member_person;
ALTER TABLE dede_member_pms RENAME TO bole__member_pms;
ALTER TABLE dede_member_snsmsg RENAME TO bole__member_snsmsg;
ALTER TABLE dede_member_space RENAME TO bole__member_space;
ALTER TABLE dede_member_stow RENAME TO bole__member_stow;
ALTER TABLE dede_member_stowtype RENAME TO bole__member_stowtype;
ALTER TABLE dede_member_tj RENAME TO bole__member_tj;
ALTER TABLE dede_member_type RENAME TO bole__member_type;
ALTER TABLE dede_member_vhistory RENAME TO bole__member_vhistory;
ALTER TABLE dede_moneycard_record RENAME TO bole__moneycard_record;
ALTER TABLE dede_moneycard_type RENAME TO bole__moneycard_type;
ALTER TABLE dede_mtypes RENAME TO bole__mtypes;
ALTER TABLE dede_multiserv_config RENAME TO bole__multiserv_config;
ALTER TABLE dede_myad RENAME TO bole__myad;
ALTER TABLE dede_myadtype RENAME TO bole__myadtype;
ALTER TABLE dede_mytag RENAME TO bole__mytag;
ALTER TABLE dede_orders RENAME TO bole__orders;
ALTER TABLE dede_payment RENAME TO bole__payment;
ALTER TABLE dede_plus RENAME TO bole__plus;
ALTER TABLE dede_plus_changyan_importids RENAME TO bole__plus_changyan_importids;
ALTER TABLE dede_plus_changyan_insertids RENAME TO bole__plus_changyan_insertids;
ALTER TABLE dede_plus_changyan_setting RENAME TO bole__plus_changyan_setting;
ALTER TABLE dede_plus_seoinfo RENAME TO bole__plus_seoinfo;
ALTER TABLE dede_purview RENAME TO bole__purview;
ALTER TABLE dede_pwd_tmp RENAME TO bole__pwd_tmp;
ALTER TABLE dede_ratings RENAME TO bole__ratings;
ALTER TABLE dede_scores RENAME TO bole__scores;
ALTER TABLE dede_search_cache RENAME TO bole__search_cache;
ALTER TABLE dede_search_keywords RENAME TO bole__search_keywords;
ALTER TABLE dede_sgpage RENAME TO bole__sgpage;
ALTER TABLE dede_shops_delivery RENAME TO bole__shops_delivery;
ALTER TABLE dede_shops_orders RENAME TO bole__shops_orders;
ALTER TABLE dede_shops_products RENAME TO bole__shops_products;
ALTER TABLE dede_shops_userinfo RENAME TO bole__shops_userinfo;
ALTER TABLE dede_softconfig RENAME TO bole__softconfig;
ALTER TABLE dede_sphinx RENAME TO bole__sphinx;
ALTER TABLE dede_stepselect RENAME TO bole__stepselect;
ALTER TABLE dede_sys_enum RENAME TO bole__sys_enum;
ALTER TABLE dede_sys_module RENAME TO bole__sys_module;
ALTER TABLE dede_sys_set RENAME TO bole__sys_set;
ALTER TABLE dede_sys_task RENAME TO bole__sys_task;
ALTER TABLE dede_sysconfig RENAME TO bole__sysconfig;
ALTER TABLE dede_tagindex RENAME TO bole__tagindex;
ALTER TABLE dede_taglist RENAME TO bole__taglist;
ALTER TABLE dede_uploads RENAME TO bole__uploads;
ALTER TABLE dede_verifies RENAME TO bole__verifies;
ALTER TABLE dede_vote RENAME TO bole__vote;
ALTER TABLE dede_vote_member RENAME TO bole__vote_member;
五、可以看到数据库表前缀已经成功把dede_改成了bole_ 当然大家可以修改成任意的前缀符,在代码中替换一下即可
六、还没有完,最重要的是还需要在数据库配置文件中把表前缀修改统一,不然网站打不开喽!
总结:大功告成!!!
七、如果大家用的是云优cms系统建站修改数据库表前缀,可在步骤4处修改下代码即可
ALTER TABLE yunu_admin RENAME TO bole_admin;
ALTER TABLE yunu_area RENAME TO bole_area;
ALTER TABLE yunu_auth_group RENAME TO bole_auth_group;
ALTER TABLE yunu_auth_group_access RENAME TO bole_auth_group_access;
ALTER TABLE yunu_auth_rule RENAME TO bole_auth_rule;
ALTER TABLE yunu_banner RENAME TO bole_banner;
ALTER TABLE yunu_block RENAME TO bole_block;
ALTER TABLE yunu_block_category RENAME TO bole_block_category;
ALTER TABLE yunu_browse RENAME TO bole_browse;
ALTER TABLE yunu_category RENAME TO bole_category;
ALTER TABLE yunu_content RENAME TO bole_content;
ALTER TABLE yunu_diyfield RENAME TO bole_diyfield;
ALTER TABLE yunu_diyform RENAME TO bole_diyform;
ALTER TABLE yunu_diymodel RENAME TO bole_diymodel;
ALTER TABLE yunu_diy_article RENAME TO bole_diy_article;
ALTER TABLE yunu_diy_image RENAME TO bole_diy_image;
ALTER TABLE yunu_diy_page RENAME TO bole_diy_page;
ALTER TABLE yunu_diy_product RENAME TO bole_diy_product;
ALTER TABLE yunu_diy_productdiy RENAME TO bole_diy_productdiy;
ALTER TABLE yunu_formcon RENAME TO bole_formcon;
ALTER TABLE yunu_form_demo RENAME TO bole_form_demo;
ALTER TABLE yunu_link RENAME TO bole_link;
ALTER TABLE yunu_log RENAME TO bole_log;
ALTER TABLE yunu_redirecturl RENAME TO bole_redirecturl;
ALTER TABLE yunu_sitelink RENAME TO bole_sitelink;
ALTER TABLE yunu_tagurl RENAME TO bole_tagurl;
请立即点击咨询我们或拨打咨询热线: 18031152740,我们会详细为你一一解答你心中的疑难。业务经理在线