2011-05-31 66 views
3

我想分享有關上述問題的解決方案,因此您可以節省一些時間。解決方案很簡單。您只需重命名PLESK 10(數據庫psa)使用的所有表。使用您喜歡的MySQL客戶端並連接到數據庫,然後執行以下SQL腳本:我想打開mysql中的lower_case_table_names,但PLESK 10停止工作

<!-- language: sql --> 
    USE psa ; 
    RENAME TABLE APSApplicationItems to apsapplicationitems ; 
    RENAME TABLE APSCatalogUpdates to apscatalogupdates ; 
    RENAME TABLE APSClientApplicationItems to apsclientapplicationitems ; 
    RENAME TABLE APSLicenseTypes to apslicensetypes ; 
    RENAME TABLE APSLicenses to apslicenses ; 
    RENAME TABLE ApiRpcCallsStat to apirpccallsstat ; 
    RENAME TABLE BackendCache to backendcache ; 
    RENAME TABLE BackupsRunning to backupsrunning ; 
    RENAME TABLE BackupsScheduled to backupsscheduled ; 
    RENAME TABLE BackupsSettings to backupssettings ; 
    RENAME TABLE Cards to cards ; 
    RENAME TABLE ClientsTraffic to clientstraffic ; 
    RENAME TABLE Components to components ; 
    RENAME TABLE Configurations to configurations ; 
    RENAME TABLE DashboardPreset to dashboardpreset ; 
    RENAME TABLE DashboardPresetConfig to dashboardpresetconfig ; 
    RENAME TABLE DatabaseServers to databaseservers ; 
    RENAME TABLE DomainServices to domainservices ; 
    RENAME TABLE DomainsTraffic to domainstraffic ; 
    RENAME TABLE GL_remote_domains to gl_remote_domains ; 
    RENAME TABLE GL_settings to gl_settings ; 
    RENAME TABLE IP_Addresses to ip_addresses ; 
    RENAME TABLE IpAddressesCollections to ipaddressescollections ; 
    RENAME TABLE IpCollections to ipcollections ; 
    RENAME TABLE Limits to limits ; 
    RENAME TABLE Logos to logos ; 
    RENAME TABLE MailLists to maillists ; 
    RENAME TABLE MailMessagesStat to mailmessagesstat ; 
    RENAME TABLE Modules to modules ; 
    RENAME TABLE Notes to notes ; 
    RENAME TABLE Notifications to notifications ; 
    RENAME TABLE PMM to pmm ; 
    RENAME TABLE PMMDefault to pmmdefault ; 
    RENAME TABLE Parameters to parameters ; 
    RENAME TABLE Permissions to permissions ; 
    RENAME TABLE PersistentCache to persistentcache ; 
    RENAME TABLE PlanItemProperties to planitemproperties ; 
    RENAME TABLE PlanItems to planitems ; 
    RENAME TABLE PlansSubscriptions to planssubscriptions ; 
    RENAME TABLE PleskPagesStat to pleskpagesstat ; 
    RENAME TABLE Repository to repository ; 
    RENAME TABLE SBConfig to sbconfig ; 
    RENAME TABLE SBResellers to sbresellers ; 
    RENAME TABLE SBSites to sbsites ; 
    RENAME TABLE SSOBranding to ssobranding ; 
    RENAME TABLE SiteAppFiles to siteappfiles ; 
    RENAME TABLE SiteAppPackages to siteapppackages ; 
    RENAME TABLE SiteAppResources to siteappresources ; 
    RENAME TABLE SiteApps to siteapps ; 
    RENAME TABLE SiteAppsHitsStat to siteappshitsstat ; 
    RENAME TABLE SitePagesStat to sitepagesstat ; 
    RENAME TABLE Skins to skins ; 
    RENAME TABLE SubscriptionProperties to subscriptionproperties ; 
    RENAME TABLE Subscriptions to subscriptions ; 
    RENAME TABLE Templates to templates ; 
    RENAME TABLE TmplData to tmpldata ; 
    RENAME TABLE WebApps to webapps ; 
    RENAME TABLE Webmails to webmails ; 
    RENAME TABLE externalWebmails to externalwebmails ; 
    RENAME TABLE smb_apsBundleFilterItems to smb_apsbundlefilteritems ; 
    RENAME TABLE smb_apsBundleFilters to smb_apsbundlefilters ; 
    RENAME TABLE smb_apsCategories to smb_apscategories ; 
    RENAME TABLE smb_apsContexts to smb_apscontexts ; 
    RENAME TABLE smb_apsImportedResources to smb_apsimportedresources ; 
    RENAME TABLE smb_apsImportedSettings to smb_apsimportedsettings ; 
    RENAME TABLE smb_apsInstanceErrors to smb_apsinstanceerrors ; 
    RENAME TABLE smb_apsInstances to smb_apsinstances ; 
    RENAME TABLE smb_apsMetas to smb_apsmetas ; 
    RENAME TABLE smb_apsPackageUpdates to smb_apspackageupdates ; 
    RENAME TABLE smb_apsPackages to smb_apspackages ; 
    RENAME TABLE smb_apsPackagesCategories to smb_apspackagescategories ; 
    RENAME TABLE smb_apsProvisionEnvironments to smb_apsprovisionenvironments ; 
    RENAME TABLE smb_apsProvisions to smb_apsprovisions ; 
    RENAME TABLE smb_apsResourceParameters to smb_apsresourceparameters ; 
    RENAME TABLE smb_apsResources to smb_apsresources ; 
    RENAME TABLE smb_apsSettings to smb_apssettings ; 
    RENAME TABLE smb_componentUpdates to smb_componentupdates ; 
    RENAME TABLE smb_emailAliases to smb_emailaliases ; 
    RENAME TABLE smb_fileSharingUnlistedFiles to smb_filesharingunlistedfiles ; 
    RENAME TABLE smb_generalPermissions to smb_generalpermissions ; 
    RENAME TABLE smb_productUpgrades to smb_productupgrades ; 
    RENAME TABLE smb_roleGeneralPermissions to smb_rolegeneralpermissions ; 
    RENAME TABLE smb_roleServicePermissions to smb_roleservicepermissions ; 
    RENAME TABLE smb_serviceEntryPoints to smb_serviceentrypoints ; 
    RENAME TABLE smb_serviceInstances to smb_serviceinstances ; 
    RENAME TABLE smb_servicePermissionAccounts to smb_servicepermissionaccounts ; 
    RENAME TABLE smb_servicePermissions to smb_servicepermissions ; 
    RENAME TABLE smb_serviceProviders to smb_serviceproviders ; 
    RENAME TABLE smb_userServicePermissions to smb_userservicepermissions ; 

然後找到my.cnf文件(通常是 - UNIX:/etc/mysql/my.cnf;窗口:/ CONF/my.cnf)中的變化(或添加,如果它不存在的話)的下面的行:

的lower_case_table_names = 1

+1

感謝您發佈解決方案,但是這應該仍然保留「que stion-then-answer「模式。也就是說,請自己發佈答案,然後一定要將其標記爲已接受。這可以使事情保持一致,但也有助於避免您收到差評。 – 2011-05-31 13:41:39

+0

對問題的滿意度也讓你獲得5個代表,而對答案的滿意度讓你10 :-)。 – Johan 2011-05-31 13:56:00

+0

您能否解釋一下這個解決方案可以解決哪個問題? – 2013-05-13 03:32:47

回答

1

腳本:

  1. 生成rename_psa.sql:

    表中echo "show tables" | mysql -N psa | grep [A-Z];請回顯「RENAME TABLE $ table TO $(echo $ table | tr A-Z a-z);」 ;完成> rename_psa.sql

  2. 備份表&運行腳本

    mysqldump的--opt PSA> psa.sql

    MySQL的PSA < rename_psa.sql

  3. 編輯/etc/my.cnf中& done

+0

很好的解決方法。感謝分享! – d33t 2011-07-06 10:49:38