# mySQL SQL query with LIMIT 10 generates popup error when initializing query

**URL:** <https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448>\
**Category:** Database\
**Created:** [October 30, 2016, 2:58pm UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448 "2016-10-30T14:58:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![victoria-williams](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@victoria-williams](https://forum.bubble.io/u/victoria-williams)\
**Post date:** [October 30, 2016, 2:58pm UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/1 "2016-10-30T14:58:48Z")

</div>

I cannot initialise a basic select with a LIMIT 10. Error pop up ‘Please limit the query to at most 200 entries’.

Is there something I am missing: My query working in MySQL Workbench and brings back the 10 rows but the front end doesn’t seem to recognise the LIMIT clause.

---

<div class="post-metadata">

**Author:** ![emmanuel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/emmanuel/32/27657_2.png) [@emmanuel](https://forum.bubble.io/u/emmanuel)\
**Post date:** [October 30, 2016, 5:03pm UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/2 "2016-10-30T17:03:21Z")

</div>

Can you share the query you’re running?

---

<div class="post-metadata">

**Author:** ![victoria-williams](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@victoria-williams](https://forum.bubble.io/u/victoria-williams)\
**Post date:** [October 30, 2016, 5:56pm UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/3 "2016-10-30T17:56:11Z")

</div>

select column\_name  
from table\_name  
LIMIT 10;

where column name is a actual column and table\_name is the actual table name.

---

<div class="post-metadata">

**Author:** ![mishav](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mishav/32/6420_2.png) [@mishav](https://forum.bubble.io/u/mishav)\
**Post date:** [October 30, 2016, 6:36pm UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/4 "2016-10-30T18:36:48Z")

</div>

I get the same issue, just didn’t realise it before! On my own database MySQL version 5.5.52-0+deb8u1

The limit works when I connect to the “employees” database in @georgeciobanu 's example on MySQL version 5.6.28-0ubuntu0.15.10.1 …

> [@\[New Feature\] Database connector](http://forum.bubble.io/t/new-feature-database-connector/1961/5):
>
> Thanks for asking - I updated the documentation (deploying soon) but here it is postgres://user:password@server\_address:port/database\_name. For MySQL replace ‘postgres’ with ‘mysql’ Concrete example: postgres://ricardo:secret\_password@128.203.134.78:5432/employees Now, your server port / configuration might differ. Here are the steps I took to test, generally going up the OSI stack (see [https://support.rackspace.com/how-to/mysql-connect-to-your-database-remotely/](https://support.rackspace.com/how-to/mysql-connect-to-your-database-remotely/)) Can I ping the remote ser…

select \* from employees limit 2

EDIT: spoke too soon, the limit is working on both databases … my other test had an additional filter.

---

<div class="post-metadata">

**Author:** ![victoria-williams](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@victoria-williams](https://forum.bubble.io/u/victoria-williams)\
**Post date:** [October 31, 2016, 7:43pm UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/5 "2016-10-31T19:43:40Z")

</div>

select \*  
from fabrics  
limit 10;

This is still generating a “Please limit to at least 200 records” pop up message. Please help.  
I am able to access my database which is hosted on AWS via MySQL Workbench locally on my machine so there is no connection issues. The SQL I have wrote is valid and produces the correct results as per the LIMIT applied.

---

<div class="post-metadata">

**Author:** ![mishav](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mishav/32/6420_2.png) [@mishav](https://forum.bubble.io/u/mishav)\
**Post date:** [November 1, 2016, 3:43am UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/6 "2016-11-01T03:43:06Z")

</div>

> [@victoria-williams](#):
>
> select \*  
> from fabrics  
> limit 10;

Does it work without the semicolon?

---

<div class="post-metadata">

**Author:** ![victoria-williams](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@victoria-williams](https://forum.bubble.io/u/victoria-williams)\
**Post date:** [November 1, 2016, 9:29am UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/7 "2016-11-01T09:29:50Z")

</div>

Hi,

No, tried with and without ☹

---

<div class="post-metadata">

**Author:** ![mishav](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mishav/32/6420_2.png) [@mishav](https://forum.bubble.io/u/mishav)\
**Post date:** [November 1, 2016, 6:45pm UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/8 "2016-11-01T18:45:14Z")

</div>

I just tried with newlines like yours, and got the same error message.  
Try it all on one line:  
select \* from fabrics limit 10

---

<div class="post-metadata">

**Author:** ![victoria-williams](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@victoria-williams](https://forum.bubble.io/u/victoria-williams)\
**Post date:** [November 1, 2016, 9:35pm UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/9 "2016-11-01T21:35:10Z")

</div>

You are a star! that worked, I can move forward 🙂  
Thank you for taking the time to reply.

---

<div class="post-metadata">

**Author:** ![toby2](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/toby2/32/99439_2.png) [@toby2](https://forum.bubble.io/u/toby2)\
**Post date:** [November 2, 2021, 12:59pm UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/10 "2021-11-02T12:59:52Z")

</div>

This problem still exists…

I get the issue with this command:  
`SELECT topicID FROM mydb.dbo.Cantariri LIMIT 10`

---

<div class="post-metadata">

**Author:** ![trodi.app](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@trodi.app](https://forum.bubble.io/u/trodi.app)\
**Post date:** [November 30, 2021, 8:24pm UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/11 "2021-11-30T20:24:18Z")

</div>

I have this problem. it has a limit of 200. But I have a table with 3 columns and 3 rows, only 3 rows of records.  
I’ve written in different ways and it always gives the LIMIT 200… no other type of error.

select \* from mgv.tb\_produtos;  
select 10 from mgv.tb\_produtos;

Database mysql 8.  
connect OK, but no return data;

---

<div class="post-metadata">

**Author:** ![joeyg](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@joeyg](https://forum.bubble.io/u/joeyg)\
**Post date:** [December 3, 2021, 7:05pm UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/12 "2021-12-03T19:05:43Z")

</div>

Bubble enforces that you put a LIMIT clause at the end of your select statements to ensure you aren’t submitting huge queries that could return thousands of rows. Currently the maximum setting for the limit is 200. So:

select \* from mgv.tb\_produtos limit 200;

This will return your 3 rows and as the database grows, up to 200 rows.

---

<div class="post-metadata">

**Author:** ![anon20501495](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@anon20501495](https://forum.bubble.io/u/anon20501495)\
**Post date:** [April 16, 2022, 7:41am UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/14 "2022-04-16T07:41:42Z")

</div>

it still doesn’t work.  
No matter what I do I always get this error, this is a very simple sample query:

SELECT \* FROM db limit 200;

I even tried uppercase:

SELECT \* FROM db LIMIT 200;

same error, there is no way for me to make this plugin work.

---

<div class="post-metadata">

**Author:** ![anon20501495](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@anon20501495](https://forum.bubble.io/u/anon20501495)\
**Post date:** [April 16, 2022, 7:55am UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/15 "2022-04-16T07:55:56Z")

</div>

Also, this plugin doesn’t work with MS SQL either, even if there is an option to setup an MS SQL connection. It looks for a LIMIT but MS SQL doesn’t have LIMIT, it uses TOP, therefore no queries work.

---

<div class="post-metadata">

**Author:** ![joeyg](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@joeyg](https://forum.bubble.io/u/joeyg)\
**Post date:** [April 18, 2022, 8:27pm UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/16 "2022-04-18T20:27:10Z")

</div>

You’re typing “select \* from db limit 200”. But you don’t select from a database, you select from a table. Might help if you past an image of the API connection code and show the error you are getting.

---

<div class="post-metadata">

**Author:** ![christo1](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@christo1](https://forum.bubble.io/u/christo1)\
**Post date:** [April 18, 2022, 8:59pm UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/17 "2022-04-18T20:59:43Z")

</div>

You simply start your MS SQL statement with select top 200 … I have over 100 queries in MS SQL and they definitely work!

---

<div class="post-metadata">

**Author:** ![giuliaccio](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/giuliaccio/32/128196_2.png) [@giuliaccio](https://forum.bubble.io/u/giuliaccio)\
**Post date:** [April 19, 2022, 5:59am UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/18 "2022-04-19T05:59:55Z")

</div>

Forget this plugin. I have tried so many times with different MS SQL servers, it simply doesn’t work.  
Use APIs instead.

---

<div class="post-metadata">

**Author:** ![anon20501495](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@anon20501495](https://forum.bubble.io/u/anon20501495)\
**Post date:** [April 19, 2022, 7:32am UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/19 "2022-04-19T07:32:16Z")

</div>

sorry, I took for granted the fact I was quering the table and not the DB.  
The same queries perfectly work on server’s console, it’s just this Bubble plugin that don’t like them. No matter what I write as a query I always get the 200 record error.

---

<div class="post-metadata">

**Author:** ![anon20501495](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@anon20501495](https://forum.bubble.io/u/anon20501495)\
**Post date:** [April 19, 2022, 7:36am UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/21 "2022-04-19T07:36:20Z")

</div>

I finally made it, you need to use TOP and not LIMIT. You need to use TOP without parenteses, otherwise you get that error. Thank you.  
The problem now is, how do you get the \> 200 records if you can’t use OFFSET / FETCH?

---

<div class="post-metadata">

**Author:** ![joeyg](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@joeyg](https://forum.bubble.io/u/joeyg)\
**Post date:** [April 19, 2022, 11:08pm UTC](https://forum.bubble.io/t/mysql-sql-query-with-limit-10-generates-popup-error-when-initializing-query/7448/22 "2022-04-19T23:08:32Z")

</div>

There are lots of answers in the forum to that one. Just search something like Limit 200.
