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 7715359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:21:56+00:00 2026-06-01T02:21:56+00:00

I am using Engine InnoDB on my MySQL server. I have a patch script

  • 0

I am using Engine InnoDB on my MySQL server.

I have a patch script to upgrade my tables like add new columns and fill in default data.

I want to make sure there is no other session using the database. So I need a way to lock the database:

  1. The lock shouldn’t kick out an existing session. If their is any other existing session just fail the lock and report error
  2. The lock need to prevent other sessions to read/write/change the database.

Thanks a lot everyone!

  • 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-06-01T02:21:57+00:00Added an answer on June 1, 2026 at 2:21 am

    You don’t need to worry about locking tables yourself. As the MySQL documentation (http://dev.mysql.com/doc/refman/5.1/en/alter-table.html) says:

    In most cases, ALTER TABLE makes a temporary copy of the original
    table. MySQL waits for other operations that are modifying the table,
    then proceeds. It incorporates the alteration into the copy, deletes
    the original table, and renames the new one. While ALTER TABLE is
    executing, the original table is readable by other sessions. Updates
    and writes to the table that begin after the ALTER TABLE operation
    begins are stalled until the new table is ready, then are
    automatically redirected to the new table without any failed updates.

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

Sidebar

Related Questions

We're using MySQL with Innodb Engine storage. We have an evented environment that sends
i'm trying to develop a client-server chat application using java servlets and mysql(innoDB engine)
I am using mysql and mysql workbench. I created 5 tables with innodb engine.
I am using the InnoDB MySQL engine. I am doing the encryption in a
We have a very large (10million+) row table stored in MySql using the InnoDB
We're using MySQL with InnoDB storage engine and transactions a lot, and we've run
My MySQL database contains several tables using different storage engines (specifically myisam and innodb).
Why mysql is not using index_merge? Looks like my server has index_merge ON, but
I'm using App Engine, SDK 1.6.3 with Python 2.7. I've created a model like
When i try to initialize velocity engine using VelocityEngine engine = new VelocityEngine(); engine.init();

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.