Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #21  
Old 09-10-2015, 07:46 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What are the exact errors you are facing?
Also, do not use quotes around the database/table name, that is not valid SQL.
Reply With Quote
  #22  
Old 09-11-2015, 06:21 AM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The error is:
PHP Code:

INSERT INTO 
"muscle-mecca-BackUp.post" (SELECT FROM meccaaugust-backup.post WHERE threadid IN (SELECT threadid FROM "muscle-mecca-BackUp.thread"))          MySQL said: [img]https://vborg.vbsupport.ru/[/img] 
  #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 '"muscle-mecca-BackUp.post"
(SELECT *
FROM meccaaugust-backup.post
WHERE threa
' at line 1 
When I ran this:

PHP Code:

INSERT INTO 
"muscle-mecca-BackUp.post"
(SELECT *
FROM meccaaugust-backup.post
WHERE threadid IN 
(SELECT threadid FROM "muscle-mecca-BackUp.thread")) 
when I ran on the live database:

PHP Code:

muscle
-mecca-BackUp 
Thanks
Reply With Quote
  #23  
Old 09-11-2015, 08:10 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes you get that error because you wrap your database and table name in quotes. Remove the quotes.
Reply With Quote
  #24  
Old 09-11-2015, 08:30 AM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I will rerun it but I got the same type of error before I added those.

--------------- Added [DATE]1441967876[/DATE] at [TIME]1441967876[/TIME] ---------------

Ok,

ran:
PHP Code:

INSERT INTO muscle
-mecca-BackUp.post
(SELECT *
FROM meccaaugust-backup.post
WHERE threadid IN 
(SELECT threadid FROM muscle-mecca-BackUp.thread)) 

Got:
PHP Code:

INSERT INTO muscle
-mecca-BackUp.post (SELECT FROM meccaaugust-backup.post WHERE threadid IN (SELECT threadid FROM muscle-mecca-BackUp.thread))          MySQL said: [IMG]https://74.208.174.189:8443/domains/databases/phpMyAdmin/themes/dot.gif[/IMG] 
  #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 '-mecca-BackUp.post
(SELECT *
FROM meccaaugust-backup.post
WHERE threadid IN 
(' at line 1 
--------------- Added [DATE]1441969060[/DATE] at [TIME]1441969060[/TIME] ---------------

not sure why but cant edit this
Reply With Quote
  #25  
Old 09-11-2015, 09:15 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have a feeling it's messing up because you have dashes in your database name. Is it possible for you to rename it to something else, alphanumeric characters only? Then try it again.
Reply With Quote
  #26  
Old 09-11-2015, 01:30 PM
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
Posts: 969
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this query. The database needs to be backticked seperately from the table name, and I've added IGNORE after INSERT.

Code:
INSERT IGNORE INTO `muscle-mecca-BackUp`.`post`
(SELECT *
FROM `meccaaugust-backup`.`post`
WHERE threadid IN (SELECT threadid FROM `muscle-mecca-BackUp`.`thread`))
Reply With Quote
2 благодарности(ей) от:
John Lester, RichieBoy67
  #27  
Old 09-12-2015, 12:06 AM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Error says select command denied for user.. I think I know the issue though. I need both databases to use the same user. Right?

Ok, think I got it.. Checking now!

Thanks

--------------- Added [DATE]1442031673[/DATE] at [TIME]1442031673[/TIME] ---------------

Very strange, this did work on the back ups but now I change the name and am getting an error saying the post table doesn't exist.

######.post table doesn't exist This is for the live database, not the back up. I do not understand it.

--------------- Added [DATE]1442049184[/DATE] at [TIME]1442049184[/TIME] ---------------

Ok, I got it. I believe the last issue had something to do with the log for that table. I ended up copying that entire database to a new one and then running the last query there. Perfect!

This actually leads me to a new topic I will be posting about which is how and why my site actually started ranking better and getting more traffic after almost 400,000 posts were removed.

Thanks!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:04 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03977 seconds
  • Memory Usage 2,241KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (7)post_thanks_box
  • (2)post_thanks_box_bit
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete