Home > Database > phpMyAdmin > body text

How to modify the table prefix in phpmyadmin

藏色散人
Release: 2020-04-01 09:56:04
Original
2533 people have browsed it

How to modify the table prefix in phpmyadmin

How does phpmyadmin modify the table prefix?

In this example, it is assumed that the table with the prefix "phpcms_" in the database named "www_sdck_cn" is modified, and the prefix of all tables that meet the conditions is modified to "sdck_".

1. Use phpMyAdmin to open the database www_sdck_cn whose prefix you want to modify, and execute the following SQL statement (the bold and italic words need to be replaced according to actual needs):

Select CONCAT( 'ALTER TABLE ', table_name, ' RENAME TO ', replace(table_name,'phpcms_','sdck_'),';')
from information_schema.tables
where TABLE_SCHEMA = 'www_sdck_cn' and table_name LIKE 'phpcms_%';
Copy after login

How to modify the table prefix in phpmyadmin

2. Click "Export" on the page generated by executing the SQL statement, select "Customize"->"Display directly as text", CSV format, clear" "Content separator" is empty

How to modify the table prefix in phpmyadmin

3. After executing the export function, you will reach the result window as shown below. Copy the content in the text box

How to modify the table prefix in phpmyadmin

4. Enter the SQL execution window of the database "www_sdck_cn", paste the code into the SQL text box, and execute. Check to see if the relevant data table has been modified.

How to modify the table prefix in phpmyadmin

Notes

Data operations are risky, please back up the data before operation.

The above is the detailed content of How to modify the table prefix in phpmyadmin. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!