When multiple websites share the same MySQL database, different websites use different prefixes to differentiate database management. How to batch modify existing
When multiple websites share the same MySQL database, different websites use different prefixes to differentiate database management. How to batch modify existing
When multiple websites share the same MySQL database, different websites use different prefixes to differentiate database management. How can I modify the prefix names of an existing database in batches? Export all the modifications before importing them? Or a table or a table? Today, I want to introduce a relatively simple method to modify the table prefix in a database in batches. This method is suitable for modifying databases with the same prefix and a large number of data tables.
In this example, modify the table prefixed with "phpcms _" in the database named "www_linuxidc_com" and change the prefix of all qualified tables to "linuxidc _".
1. Use phpMyAdmin to open the database www_linuxidc_com whose prefix is to be modified, and execute the following SQL statement (the bold italic must be replaced according to actual needs ):
Select CONCAT ('alter table', table_name, 'rename TO ', replace (table_name, 'phpcms _', 'linuxidc _'),';')
From information_schema.tables
Where TABLE_SCHEMA = 'www _ linuxidc_com 'and table_name LIKE 'phpcms _ % ';
2. On the SQL statement generation page, click "Export" and choose "Custom"> "display as text directly" to export the txt format.
3. After the export function is executed, the result window is displayed as follows. Copy the content in the text box ------- here, you may need to handle it first due to different versions.
4. Execute the alert statement in txt.
The exported alert statement is similar
Alter table v9_admin rename to yanglao_admin;
Example of LAMP architecture collaborative application-phpMyAdmin
PhpMyAdmin and Wordpress for LAMP applications
PhpMyAdmin logon timeout Solution
Install phpMyAdmin and Adminer in Ubuntu
Implement SSL functions based on LAMP and install phpMyAdmin
Configure the LAMP + phpMyAdmin PHP (5.5.9) development environment in Ubuntu 14.04
PhpMyAdmin details: click here
PhpMyAdmin: click here
This article permanently updates the link address: