mysql中存儲json格式數據的方法
具體方法如下:
#新建表
create table json_user (uid int auto_increment,
data json,
primary key(uid)
);
#插入數據
insert into json_user values (null, '{
"name":"lison",
"age":18,
"address":"enjoy"
}' );
insert into json_user values (
null,
'{
"name":"james",
"age":28,
"mail":"james@163.com"
}');