Connecting Tech Pros Worldwide Forums | Help | Site Map

Copying a table using phpMyAdmin.

Newbie
 
Join Date: Oct 2008
Location: Windsor UK
Posts: 4
#1: Oct 20 '08
2 phpbb boards I run have been hacked. One I've restored but the other one has had some damage to the MySQL db. A table is missing.

As it's a styles table I thought I could could copy a table, from a test board I set up, to the hacked board.

I tried this using phpMyAdmin and I get this error:

Expand|Select|Wrap|Line Numbers
  1. SQL-query: Edit
  2.  
  3. CREATE TABLE `Tabcom`.`phpbb_styles_imageset_data` (
  4. `image_id` smallint( 4 ) unsigned NOT NULL AUTO_INCREMENT ,
  5. `image_name` varchar( 200 ) COLLATE utf8_bin NOT NULL default '',
  6. `image_filename` varchar( 200 ) COLLATE utf8_bin NOT NULL default '',
  7. `image_lang` varchar( 30 ) COLLATE utf8_bin NOT NULL default '',
  8. `image_height` smallint( 4 ) unsigned NOT NULL default '0',
  9. `image_width` smallint( 4 ) unsigned NOT NULL default '0',
  10. `imageset_id` smallint( 4 ) unsigned NOT NULL default '0',
  11. PRIMARY KEY ( `image_id` ) ,
  12. KEY `i_d` ( `imageset_id` ) ,
  13. FULLTEXT KEY `image_name` ( `image_name` ) ,
  14. FULLTEXT KEY `image_lang` ( `image_lang` ) ,
  15. FULLTEXT KEY `image_name_2` ( `image_name` )
  16. ) ENGINE = MYISAM AUTO_INCREMENT = 79DEFAULT CHARSET = utf8 COLLATE = utf8_bin
  17.  
  18. MySQL said: Documentation
  19. #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '79DEFAULT CHARSET  = utf8 COLLATE  = utf8_bin' at line 12 
  20.  
Can you please help?

Thanks
Ashley

mwasif's Avatar
Moderator
 
Join Date: Jul 2006
Location: Pakistan
Posts: 719
#2: Oct 21 '08

re: Copying a table using phpMyAdmin.


Make sure you have space between 79 and DEFAULT in the last line of the statement i.e. 79DEFAULT
Newbie
 
Join Date: Oct 2008
Location: Windsor UK
Posts: 4
#3: Oct 21 '08

re: Copying a table using phpMyAdmin.


Quote:

Originally Posted by mwasif

Make sure you have space between 79 and DEFAULT in the last line of the statement i.e. 79DEFAULT

Thanks for your quick reply.

However the line was generated by phpMyAdmin not by me; so I cannot correct it!
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,751
#4: Oct 21 '08

re: Copying a table using phpMyAdmin.


Can't you simply copy the SQL you posted here, add the space and execute the modified SQL in phpMyAdmin's SQL window?
Newbie
 
Join Date: Oct 2008
Location: Windsor UK
Posts: 4
#5: Oct 21 '08

re: Copying a table using phpMyAdmin.


Sorry for being so thick!

Where is the SQL window in phpMyAdmin?

Ashley
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,751
#6: Oct 21 '08

re: Copying a table using phpMyAdmin.


If you select the database from the drop-down on the left, there should be a SQL tab at the top of the main window.
That should allow you to run any SQL query you need on the database.
Newbie
 
Join Date: Oct 2008
Location: Windsor UK
Posts: 4
#7: Oct 22 '08

re: Copying a table using phpMyAdmin.


Yes that worked!

I no longer get a db error but my board is still hacked.

Back to the phpbb help forum. :(

Thanks for being so patient with me.
Reply