Re-naming a table in MyWebSQL

So this was trickier than I thought.

I have a .sql dump of a database and when I imported it it was saved as wordpressblog.

I wanted it to be naylorfamily.

There is no rename function and so I needed to revert back to the command line and did it like this

mysql -u xxxxx -p"xxxxxx" wordpress -sNe 'show tables' | while read table; do mysql -u xxxxx -p"xxxxxx" -sNe "RENAME TABLE wordpress.$table TO naylorfamily.$table"; done

Leave a Reply

Your email address will not be published. Required fields are marked *