{"id":1515,"date":"2011-09-01T21:18:01","date_gmt":"2011-09-01T13:18:01","guid":{"rendered":"http:\/\/www.jpuyy.com\/blog\/?p=1515"},"modified":"2012-09-30T10:50:06","modified_gmt":"2012-09-30T02:50:06","slug":"shell-mysql-update","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=1515","title":{"rendered":"shell\u64cd\u4f5cmysql\u4e00\u5219 | sql update \u8bed\u53e5"},"content":{"rendered":"<p>\u80cc\u666f\uff0c\u6253\u7b97\u628aradius\u91cc\u6709\u51e0\u4e2a\u7528\u6237\u5728\u51cc\u6668\u6ca1\u6709\u4eba\u4e0a\u7684\u65f6\u5019\u8bbe\u4e3adisable\uff0c\u9700\u8981\u7528\u5230update\u8bed\u53e5\u548cat\u547d\u4ee4<\/p>\n<p>\u9996\u5148\u5728mysql\u91cc\u521b\u5efa\u4e86\u4e00\u4e2a\u65b0\u7684\u5e10\u53f7\uff0c\u7528\u6237\u540drrr \u5bc6\u7801ttt<\/p>\n<p>\u8981\u64cd\u4f5c\u7684\u6570\u636e\u5e93\u4e3a radius ,\u64cd\u4f5c\u51fd\u6570mysql_opt ,\u64cd\u4f5c\u8868radusergroup<\/p>\n<pre>#!\/bin\/bash\r\n#for use:disable the radius users\r\n#author: jpuyy.com\r\n#version:\r\n#history:\r\n#relate on: at mysql|update\r\nsql_user=rrr \r\nsql_pass=ttt\r\nsql_opt=\"-u$sql_user -p$sql_pass -s\"\r\n\r\nmysql_opt() {\r\ndb_name=$1\r\nsql_lan=$2\r\nmysql $sql_opt &lt;&lt; EOF\r\nUSE $db_name;\r\n$sql_lan;\r\nQUIT\r\nEOF\r\n}\r\n\r\ndata=`mysql_opt radius \"UPDATE  radusergroup SET groupname='daloRADIUS-Disabled-Users'  WHERE username in ('aaa','bbb','ccc')\"`\r\necho $data<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f\uff0c\u6253\u7b97\u628aradius\u91cc\u6709\u51e0\u4e2a\u7528\u6237\u5728\u51cc\u6668\u6ca1\u6709\u4eba\u4e0a\u7684\u65f6\u5019\u8bbe\u4e3adisable\uff0c\u9700\u8981\u7528\u5230update\u8bed\u53e5\u548cat\u547d\u4ee4 \u9996\u5148\u5728mysql\u91cc\u521b\u5efa\u4e86\u4e00\u4e2a\u65b0\u7684\u5e10\u53f7\uff0c\u7528\u6237\u540drrr \u5bc6\u7801ttt \u8981\u64cd\u4f5c\u7684\u6570\u636e\u5e93\u4e3a radius ,\u64cd\u4f5c\u51fd\u6570mysql_opt ,\u64cd\u4f5c\u8868radusergroup #!\/bin\/bash #for use:disable the radius users #author: jpuyy.com #version: #history: #relate on: at mysql|update sql_user=rrr sql_pass=ttt sql_opt=&#8221;-u$sql_user -p$sql_pass -s&#8221; mysql_opt() { db_name=$1 sql_lan=$2 mysql $sql_opt &lt;&lt; EOF USE $db_name; $sql_lan; QUIT EOF } data=`mysql_opt radius &#8220;UPDATE radusergroup SET groupname=&#8217;daloRADIUS-Disabled-Users&#8217; WHERE username in (&#8216;aaa&#8217;,&#8217;bbb&#8217;,&#8217;ccc&#8217;)&#8221;` echo $data<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[23],"class_list":["post-1515","post","type-post","status-publish","format-standard","hentry","category-linux","tag-summary"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/1515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1515"}],"version-history":[{"count":9,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/1515\/revisions"}],"predecessor-version":[{"id":1518,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/1515\/revisions\/1518"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}