{"id":80,"date":"2018-09-05T14:56:06","date_gmt":"2018-09-05T13:56:06","guid":{"rendered":"https:\/\/www.thenaylors.co.uk\/wordpress\/?p=80"},"modified":"2018-09-05T14:56:06","modified_gmt":"2018-09-05T13:56:06","slug":"re-naming-a-table-in-mywebsql","status":"publish","type":"post","link":"https:\/\/www.thenaylors.co.uk\/wordpress\/re-naming-a-table-in-mywebsql\/","title":{"rendered":"Re-naming a table in MyWebSQL"},"content":{"rendered":"\r\n<p class=\"wp-block-paragraph\">So this was trickier than I thought.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">I have a .sql dump of a database and when I imported it it was saved as wordpressblog.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">I wanted it to be naylorfamily.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">There is no rename function and so I needed to revert back to the command line and did it like this<\/p>\r\n\r\n\r\n\r\n<pre>[php]mysql -u xxxxx -p&quot;xxxxxx&quot; wordpress -sNe 'show tables' | while read table; do mysql -u xxxxx -p&quot;xxxxxx&quot; -sNe &quot;RENAME TABLE wordpress.$table TO naylorfamily.$table&quot;; done[\/php]<\/pre>\r\n","protected":false},"excerpt":{"rendered":"<p>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 [php]mysql -u xxxxx &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.thenaylors.co.uk\/wordpress\/re-naming-a-table-in-mywebsql\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Re-naming a table in MyWebSQL&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,4],"tags":[],"class_list":["post-80","post","type-post","status-publish","format-standard","hentry","category-linux-nas","category-wordpress"],"_links":{"self":[{"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/comments?post=80"}],"version-history":[{"count":2,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/80\/revisions"}],"predecessor-version":[{"id":353,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/80\/revisions\/353"}],"wp:attachment":[{"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/media?parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/categories?post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/tags?post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}