![]() |
HELP - accidentally deleted a database table OK, first want to say - I know, how stupid was that! I was deleting database tables for a plugin I no longer need and got trigger happy and deleted the wrong one. The table I deleted by mistake is wp_links - which is now causing massive errors in my error log. I have saved database backups - how can I get that one table back into my database. Please be gentle with me, I don't know much about sql's & phpmyadmin ... but can take simple instructions. Any help much appreciated! |
Re: HELP - accidentally deleted a database table First thing I would do is ask my host if they could get it out of the back up. Hostgator backs up my site every Saturday morning and sends me a notice to that effect. If you are now with Hostgator, who every you are with must have a backup schedule. |
Re: HELP - accidentally deleted a database table Great thanks for the reply. But I don't want to restore the whole database as I did a whole heap of work on the site in between. I only want the one table wp_links restored ... is that possible at all? |
Re: HELP - accidentally deleted a database table Yes. Open the backup SQL file and only execute those queries that start with Code: CREATE TABLE wp_linksCode: INSERT INTO wp_linksThe easiest way to do that is to find those lines, and delete all the stuff before and after them; they will be all together and you don't need the rest of the backup file. Then upload to your phpmyadmin, or just pipe the file in to the mysql CLI. |
Re: HELP - accidentally deleted a database table Um ... execute? Greatly appreciate your help, but I don't understand what that means. Is that in the phpmyadmin area? And do I "cut and paste" it from notepad? Sorry I am such a dumkopf! |
Re: HELP - accidentally deleted a database table I have WP Database Manager plugin installed. Can I go to the "run SQL Query" page in my WP dashboard and create the table there? It has a CREATE option, but I don't know what to do? I have found the piece from inside my sql database: CREATE TABLE etc to INSERT INTO . Would I just paste all of that into that WP Database manager page as is? Sincerely appreciate any help. |
Re: HELP - accidentally deleted a database table Sorry, I don't know what these tools are. You want to run those queries. |
Re: HELP - accidentally deleted a database table Ok thank you for the replies guys :-) |
Re: HELP - accidentally deleted a database table hello nig, you have installed WP-DBManager do this first in step by step if no go proceed to the second one and so on... 1. repair database 2. restore database if no go 3. drop/empty tables and run queries by the way what version of your DB manager? and you WP? |
Re: HELP - accidentally deleted a database table Thank you. I have the latest version of WP & WP Database Manager. See, I don't want to re-install the whole database - as I have done a lot of work on the site in the meantime. I only want to re-insert that one, single table: wp_links. But I don't fully understand the way to do it. I don't know how to run a query. I can see in WP Database manager where to do it - but don't know exactly what to put into the text box. |
Re: HELP - accidentally deleted a database table You put the queries you copied out of the backup. You said you found them. The `CREATE TABLE wp_links` and `INSERT INTO wp_links` queries. I'm sure PHPMyAdmin has some tab where you can paste SQL queries in and run them too. |
Re: HELP - accidentally deleted a database table Ok, getting there. You guys rock!... I pasted the following which is from my database backup, from the start of the CREATE TABLE to the end of the INSERT TABLE into the WP Database manager "Run SQL Query" text box, but it flicked me out to my blog's front page and the table was not added. What would be incorrect here, please? (I have allowed permissions temporarily in .htaccess and wp-config.php in case that makes a difference) CREATE TABLE `wp_links` ( `link_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `link_url` varchar(255) NOT NULL DEFAULT '', `link_name` varchar(255) NOT NULL DEFAULT '', `link_image` varchar(255) NOT NULL DEFAULT '', `link_target` varchar(25) NOT NULL DEFAULT '', `link_description` varchar(255) NOT NULL DEFAULT '', `link_visible` varchar(20) NOT NULL DEFAULT 'Y', `link_owner` bigint(20) unsigned NOT NULL DEFAULT '1', `link_rating` int(11) NOT NULL DEFAULT '0', `link_updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `link_rel` varchar(255) NOT NULL DEFAULT '', `link_notes` mediumtext NOT NULL, `link_rss` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`link_id`), KEY `link_visible` (`link_visible`) ) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `wp_links` -- LOCK TABLES `wp_links` WRITE; /*!40000 ALTER TABLE `wp_links` DISABLE KEYS */; INSERT INTO `wp_links` VALUES (8,'I DELETED LINK HERE AS NOT ALLOWED/','Techfresh','','_blank','Techfresh','Y',1,0,'000 0-00-00 00:00:00','','',''); /*!40000 ALTER TABLE `wp_links` ENABLE KEYS */; UNLOCK TABLES; |
Re: HELP - accidentally deleted a database table Perhaps the "WP Database Manager" does not let you run multiple queries at once. Don't use it. |
Re: HELP - accidentally deleted a database table You can run the querys from within PHPmyADMIN yes. In the SQL tab. |
Re: HELP - accidentally deleted a database table I dont think you will get your table back if you dont hve a backup file, so you should create a new table with data in it. |
Re: HELP - accidentally deleted a database table Quote:
|
| All times are GMT -6. The time now is 05:39 AM. |