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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:03:20+00:00 2026-06-06T01:03:20+00:00

I created a database on my computer, with MySQL 5.5 and MySQL Workbench 5.2.34

  • 0

I created a database on my computer, with MySQL 5.5 and MySQL Workbench 5.2.34 CE installed.
Then i want to migrate the database to another computer, which has MySQL 5.0 installed. (I just need to migrate the schema, data are not needed)

I use the MySQL Workbench’s File -> Export -> Forward Engineer SQL CREATE script to generate db.sql script and copy it to the other computer.

I type mysql < db.sql to create the database but only to receive an error.

Error occurs here:

DELIMITER $$

CREATE PROCEDURE `filedb`.`GetIncompleteFileId` (in latestFileId BIGINT UNSIGNED, in serverBits BIT(32), in fileCount SMALLINT UNSIGNED)

BEGIN
    SELECT `id`, `key`, `length`, `path`
    FROM
    (
        SELECT * FROM `filedb`.`fileInfo` WHERE `id` <= latestFileId
    ) AS TempTable
    WHERE (serverBits & `serverownership` NOT IN (serverBits, 0))
    ORDER BY `id` DESC
    LIMIT fileCount;
END

$$

The error is near ‘fileCount; END’.
If i remove the “LIMIT fileCount”, the error disappears.

Anyone tells me what is the 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-06-06T01:03:22+00:00Added an answer on June 6, 2026 at 1:03 am

    In the MySQL 5.0 LIMIT arguments must be nonnegative integer constants, not a variables or procedure parameters. Use prepared statements to avoid this error.

    From the MySQL 5.0 documentation –

    The LIMIT clause can be used to constrain the number of rows returned
    by the SELECT statement. LIMIT takes one or two numeric arguments,
    which must both be non-negative integer constants (except when using
    prepared statements).

    From the MySQL 5.5 documentation –

    The LIMIT clause can be used to constrain the number of rows returned
    by the SELECT statement. LIMIT takes one or two numeric arguments,
    which must both be nonnegative integer constants, with these
    exceptions:

    Within prepared statements, LIMIT parameters can be specified using ? placeholder markers.

    Within stored programs, LIMIT parameters can be specified using integer-valued routine parameters or local variables as of MySQL 5.5.6.

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

Sidebar

Related Questions

I was just looking at the MySql database created by drupal after I installed
I have a mysql database with which contains data in 5 minute bins. I'd
I need to access a mysql database from c# code but I would prefer
I've exported my MySQL database to a .txt/.sql file (link) and want to use
Yesterday I was working using MySQL installed on my computer. I downloaded xampp, so
I have an Access front-end database connected to various back-ends (Access, mySQL, dBase) which
I successfully created database on my local server using Code First, migrated it to
I am attempting to create a Stored Procedure for a newly created database. However
iv created a database with some tables and populated them using SQL server 2008,
I created a database for a site i'm doing using Django as the admin

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.