<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-work-with-json-in-mysql-fma5uugjo" -->

---
title: How To Work with JSON in MySQL | daily.dev
description: MySQL 5.7.8+ supports a native JSON data type that bridges relational and document-style storage. This tutorial walks through creating a database schema with a...
canonical: https://daily.dev/posts/how-to-work-with-json-in-mysql-fma5uugjo
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How To Work with JSON in MySQL | daily.dev
og:description: MySQL 5.7.8+ supports a native JSON data type that bridges relational and document-style storage. This tutorial walks through creating a database schema with a...
og:url: https://daily.dev/posts/how-to-work-with-json-in-mysql-fma5uugjo
og:image: https://api.daily.dev/og/posts/fma5UUgjo.png
og:image:alt: How To Work with JSON in MySQL
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How To Work with JSON in MySQL

**[DigitalOcean Community](https://daily.dev/sources/do_community)** · 23 min read · 13 upvotes · 0 comments

## Summary

MySQL 5.7.8+ supports a native JSON data type that bridges relational and document-style storage. This tutorial walks through creating a database schema with a JSON column, then demonstrates CRUD operations using MySQL's built-in JSON functions: JSON_OBJECT, JSON_ARRAY, JSON_MERGE_PRESERVE for creating data; JSON_EXTRACT (and the -> operator) for querying; JSON_INSERT, JSON_REPLACE, and JSON_SET for updating; and JSON_REMOVE for deleting specific keys. The second half covers integrating this with Laravel's Eloquent ORM, including migrations with json() column type, model casting of JSON to arrays, and querying JSON attributes using the attributes->key syntax in where clauses.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.digitalocean.com/community/tutorials/working-with-json-in-mysql>

## Similar posts on daily.dev

- [SQLite JSON Superpower: Virtual Columns \+ Indexing](https://daily.dev/posts/sqlite-json-superpower-virtual-columns-indexing-awwu21k4f) · Hacker News · 1 upvotes · 0 comments
- [Azure SQL Dev Corner](https://daily.dev/posts/azure-sql-dev-corner-yihqpgst9) · DevBlogs · 0 upvotes · 0 comments
- [Database Animations: How SQL Server’s JSON Indexes Work](https://daily.dev/posts/database-animations-how-sql-server-s-json-indexes-work-sdzvqupb8) · Brent Ozar · 0 upvotes · 0 comments
- [4 things you should be doing with JSON](https://daily.dev/posts/4-things-you-should-be-doing-with-json-fho46ojyc) · All Things Open · 1 upvotes · 0 comments

---

Tags: [#database](https://daily.dev/tags/database), [#php](https://daily.dev/tags/php), [#laravel](https://daily.dev/tags/laravel), [#mysql](https://daily.dev/tags/mysql)

[View this post on daily.dev](https://daily.dev/posts/how-to-work-with-json-in-mysql-fma5uugjo)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How To Work with JSON in MySQL","url":"https://daily.dev/posts/how-to-work-with-json-in-mysql-fma5uugjo","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-work-with-json-in-mysql-fma5uugjo"},"datePublished":"2026-03-11T17:47:40.458Z","dateModified":"2026-03-11T17:48:12.044Z","description":"MySQL 5.7.8+ supports a native JSON data type that bridges relational and document-style storage. This tutorial walks through creating a database schema with a...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f8c621694aef2795410a288946f911e1?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f8c621694aef2795410a288946f911e1?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"DigitalOcean Community","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"DigitalOcean Community","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/c1b9d07730e34ea388c39a498a753d6c","url":"https://daily.dev/sources/do_community"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-work-with-json-in-mysql-fma5uugjo","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":13},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"database,php,laravel,mysql","timeRequired":"PT23M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"DigitalOcean Community","item":"https://daily.dev/sources/do_community"},{"@type":"ListItem","position":3,"name":"How To Work with JSON in MySQL"}]}
```

