MySQL online

 

This MySQL playground allows you to test SQL online.You can test MySQL queries online (MySQL 8.0).

It is an MySQL editor online, it does not require installation. It can help to make small tests easily in a few seconds.

/!\ The data (tables, index, ...) that you create are deleted after approximately 30 minutes of inactivity.

It is not possible to use transactions (The connection is not persistent).

Typing help / Autocomplete: Ctrl-space for autocomplete.

How to test MySQL queries online?

  • Enter your SQL query in the editor, finally click on "Run" to execute it. The query result will be displayed below the editor .

  • You can also run only one query entered in the editor. To do this, simply select it before clicking on "Run".

  • If you want to export the results in csv format, click on "Export".

Code editor

The sql queries entered in the editor are saved so that you will find them during your next visits.
Warning, this is a local backup in your browser, it can be deleted at any time.

How to share SQL snippet ?

You can share SQL snippet. Click on "Share snippet" to share your SQL code.
Your database will not be backed up, this only saves the editor code! This is useful for sharing SQL code.

How to dump MySQL database ?

You can dump MySQL database to SQL file. Click on "Database > Dump DB to SQL" to export your database.


About MySQL tester

MySQL is an open-source relational database, and is also available under proprietary licenses.MySQL is used by many database-driven web applications, and also used by many popular websites!

This small tool allows you to execute queries (MySQL compiler). You can test the queries with a syntax specific to Mysql.

You can quickly test table structures, and if you are satisfied with the result, you can export your database to SQL format.

This playground gives you access to a database, with persistent data for about thirty minutes. As long as you remain active, the data will be retained.

This tool also allows to share sql queries (Useful for blogs, forums ...).

Your requests pass through the network, avoid playing with production data.You are advised not to enter passwords, authentication tokens, etc.


Export results to CSV

Separator
NULL string
Header
Save and Share SQL snippet
Save SQL code in order to share it.
Your database will not be backed up, this only saves the editor code!
Be careful, the data will be accessible to everyone, please do not save sensitive data.
Save SQL snippet
Your SQL snippet has been permanently saved and you (or anybody) can access with this link:
Password
Choice a password to modify/delete this SQL snippet later Enter password to modify this SQL snippet.Enter password to delete this SQL snippet.Enter the new password for the fork.
You can report a bug or give feedback by adding a comment (below) or by clicking "Contact me" link (at the top right hand corner of the page).

Comments




James-2020-10-22 13:11
REFERENCES command denied to user ''@'localhost' for table 'table_name'

Looks like some permissions need to be updated before we can test out foreign keys.


Cyril (Admin)-2020-10-22 13:25
Hello James, it is fixed, foreign key creation now works :)


Mariana-2020-11-03 12:43
Hallo,
I have problem with:

select top (5)
from....

The error is: execute command denied to user ''@'localhost' for routine 'top'


Cyril (Admin)-2020-11-03 12:58
Hello,

top is not supported by MySQL. You can use LIMIT:

Select * from MyTable Limit 3


Mariana-2020-11-03 13:13
ok


Dream-2020-12-10 19:46
Thanks for this wonderful practice tool!


modium sudheeshna-2020-12-15 11:03
1 row(s) affected what is this meaning.


Cyril (Admin)-2021-01-13 15:38
Hi, it means 1 row has been updated/added


Pritam-2020-12-18 07:28
SELECT * FROM Employee WHERE doj IS NULL; -> is not working, neither is 'WHERE doj IS NOT NULL'.

Everything else is awesome. Thank you very much for this webiste.


Night_Gamer_01-2021-01-19 19:02
whenever i use rollback to savepoint it shows savepoint does not exist.


Rade-2021-02-05 16:07
In ER model, a foreign key:

Select one:
a. Must be composed by just one attribute
b. Can be NULL, but when used it must refer to existing values defined in other entities/relationships
c. Can never be NULL
d. Must be a string


Bhavadharini-2021-02-17 04:25
hello,
rollback is not working. After updating the table, when i give rollback it was not roll back to the previous state.


Cyril (Admin)-2021-02-17 16:56
Hello, sorry but the connection is not persistent between the different calls. it's in my todo list.


sara lazeez-2021-03-17 15:50
hello i can't find the output


Emma-2021-04-01 11:57
Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'Reviewer.name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Has anyone experienced this and how did you solve it?


sam -2021-04-04 14:06
whenever i try to run my query it only shows that "xx" table already exist. what should i do?


Cyril (admin)-2021-05-12 15:41
Hello, by default all editor queries are executed.
You must have a create table query in the editor. You must select your query to run only this one.


PM-2021-04-15 16:37
what is this ?? Access denied for user ''@'%' to database 'test12'


Cyril (admin)-2021-05-12 15:38
Hello, your database is deleted after approximately 30 minutes of inactivity.


Henk Meijers-2021-04-27 11:44
Great tool!
I imported a simplified Northwind database.
When I do a select * from 2 tables then the column id, present in both tables, is mixed up.
Example: select * from orders inner join order_details on orders.id = order_details.order_id
First column in the grid should be orders.id but printed is the order_details.id.
The second id column is omitted.


parinita-2021-05-12 08:26
I could not find the saved file please do some updates to this wesite for saving the file for ever like others i am very dissapointed with this issue


Cyril (admin)-2021-05-12 15:44
Hello, when you saved your snippet, you need to keep the url to retrieve it.


Munal-2021-12-08 21:35
Thank you very much


David-2022-02-04 11:44
I wanted to ask why is my entry being repeated twice in the table? I am putting one query at a time only but two rows are being added at once.


Sheryan-2022-03-14 15:17
which ever table name im giving its telling one thing already existed what is this problme my name aLSO EXISTED ITS SAYS


Seth-2022-03-22 15:42
No indication is provided that a query returns no results. The current lack of response leads one to think that either there
is a "timeout" occurring in the connection, or that the tool is not functional. The following series of queries will expectedly
provide no result, but I would expect that the system response would be something like no results returned or nothing to show, but
when run as the first query, nothing happens. When I change the SELECT query to return a result, I get the (undesired but expected)
result.

Initial query:
DROP TABLE IF EXISTS test;
CREATE TABLE test (
test_id int(11) NOT NULL auto_increment,
test_date_available datetime default NULL,
PRIMARY KEY (test_id)
) ENGINE=MyISAM;
INSERT test (test_date_available) VALUES ('0001-01-01');

SELECT test_date_available FROM test WHERE test_date_available > '0001-01-01';
The above causes no response.

If I then run:
SELECT test_date_available FROM test WHERE test_date_available >= '0001-01-01';

I get one row.
Running this again:
SELECT test_date_available FROM test WHERE test_date_available > '0001-01-01';
The above causes no change in the response and (incorrectly) appears as if there is still one row/record returned.

BTW, I am aware of the potential issues with a date being stored as '0001-01-01' and is one reason that I was trying to use this
tool so that I could find one or more ways to address this occurrence from an older database that is to be used in a new(er) environment.


cyril (admin)-2022-04-06 19:42
Hello, thank you for your feedback! It is fixed :)