Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6389883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:27:34+00:00 2026-05-25T03:27:34+00:00

I am new to mysql so forgive me if the solution to my problem

  • 0

I am new to mysql so forgive me if the solution to my problem is obvious. I have a mysql database that has a number of tables that I need to archive. A number of the tables have over 1000000 rows. I have 11 tables that I am archiving and then deleting from.

A snippet from my code would be :

set @archive_before_date='2010-10-01'

create table if not exists archive_prescription as 
select * from prescription where prescriptiondate < @archive_before_date;

delete from prescription where prescriptiondate < @archive_before_date;

I am currently using mysql browser and I am running the script in the script tab. When I run the script the mysql query browser shows in task manager as not responding and mysql administrator shows only the first two archive tables. On a database with the same schema and less data the script works perfectly.

Does anyone have any hints as how to best approach this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:27:34+00:00Added an answer on May 25, 2026 at 3:27 am

    Copy the script into a file and save it to disk.

    Then run mysql -u -p < yoursavescriptname

    This will read the commands in from the script and execute them in turn.

    This command line itself could be placed in a .bat file on Windows, or an executable .sh file on *nix.

    Also you could place several mysql etc. < filename lines in the same .bat files.

    If you wanted to run this at a certain time you could then reference the .sh file from a cron entry. however, if doing this add an env in the .sh file somewhere, and redirect the output to a file as cron runs with a different environment to a logged in user.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am fairly new to MySQL and have a project in which I need
I'm very new to MySQL and I have a stored procedure that I'd like
New to mysql and php, so forgive any obvious stupidity, please! One of mysql
I'm just trying to create a new MySQL database with a few simple tables.
I have a number of exported text fields from an old access database that
During the installation I need to create new MySQL user, new database and populate
Forgive me, I am new to mysql I have this mysql table: |ID|KeyID1|KeyID2|Param|Value|... |asdf|1|2|
When I create a new MySQL database through phpMyAdmin, I have the option to
Can we create a new MySQL database( not a table, I want a new
I created a new mysql database and i want to use foreign keys with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.