远程操作
mysql远程连接:
mysql -h host -u username -p'password'
mysql远程dump并导出:
mysqldump -h host -u username -p'password' 库名 > dump.sql
mysql直接执行文件
mysqldump -h host -u username -p'password' 库名 < user.sql
json字段相关操作:
//查询:
select * from `offcn_off_main` where json_extract(json_field,"$.name") = '李四'
//修改一个:
update off_main set json_field = json_set(json_field,'$.phone', '132') WHERE id = 45
//同时修改多个
UPDATE offcn_off_main set json_field = json_set(json_field,'$.name',456,'$.age','bbb') WHERE id = 45
//插入:
UPDATE offcn_off_main set json_field = json_insert(json_field,'$.pwd','111') WHERE id = 45
//删除
UPDATE offcn_off_main set json_field = json_remove(json_field,'$.pwd','$.phone') WHERE id = 45
标签:set,off,记录,mysql,field,json,Mysql,main
From: https://www.cnblogs.com/yyfyy/p/17152102.html