, Wordpress , , Wordpress wp_, wp_.
I created another database called wordpress, now I want to move all the tables with wp_ to this database.
Here is what I did:
SELECT CONCAT('ALTER TABLE olddb.', table_name, ' RENAME wordpress.', table_name, ';')
FROM information_schema.tables
WHERE table_schema='olddb' AND table_name LIKE 'wp%'
INTO OUTFILE '/tmp/move_to_wordpress';
SOURCE /tmp/move_to_wordpress;
What is it.
source
share