{"id":177057,"date":"2013-04-17T18:39:03","date_gmt":"2013-04-17T14:39:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=177057"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=177057","title":{"rendered":"<span class=\"post_title\">MySQL On air. \u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043c SQL \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u044f\u0441\u044c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430 \u0438\u043b\u0438 \u0438\u043d\u0430\u044f CMS \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u044e\u0449\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0443. <br \/>  \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0442\u0435\u043c\u0430 \u2014 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u0430\u0437(\u043e\u0439|\u0430\u043c\u0438) \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0435. \u0427\u0442\u043e-\u0442\u043e, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u043a\u0430\u043a \u0441 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c \u0434\u0432\u0438\u0436\u043a\u043e\u043c, \u0442\u0430\u043a \u0438 \u0441 \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439.<br \/>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0443 \u0432\u0430\u0441 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u043e\u043c \u0438 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u043b\u0438 \u0441\u043c\u0435\u043d\u0430 \u043f\u0430\u0440\u043e\u043b\u0435\u0439.<\/p>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0445 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0411\u0414 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043b\u0430\u0442\u043d\u044b\u043c\u0438 [<a href=\"https:\/\/www.webyog.com\/product\/sqlyog\">\u0440\u0430\u0437<\/a>, <a href=\"http:\/\/www.nagios.com\/solutions\/mysql-monitoring\">\u0434\u0432\u0430<\/a>]. \u042f \u0445\u043e\u0442\u0435\u043b \u0447\u0442\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043b\u0435\u0433\u043a\u043e\u0435 \u0438 \u0443\u0434\u043e\u0431\u043d\u043e\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u0431\u0440\u0430\u043b mysql-proxy. \u0425\u043e\u0442\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0448\u0438\u0440\u0435 \u0447\u0435\u043c \u043c\u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u044f \u043e\u043f\u0438\u0448\u0443 \u043b\u0438\u0448\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043f\u043e\u0434 Windows, \u0442\u0430\u043a \u0438 \u043f\u043e\u0434 Unix \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u0443\u0442: <a href=\"http:\/\/dev.mysql.com\/downloads\/mysql-proxy\/\">dev.mysql.com\/downloads\/mysql-proxy\/<\/a><br \/>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u043e\u0432\u0435\u0439\u0448\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u00abMySQL Proxy 0.8.3 alpha\u00bb, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u041e\u0421 \u0443 \u043c\u0435\u043d\u044f \u0441\u0442\u043e\u0438\u0442 Windows 7, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u043d\u0430 \u043d\u0435\u0439.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u00abDownload\u00bb \u0432\u0430\u0441 \u043f\u043e\u043f\u0440\u043e\u0441\u044f\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043b\u0438\u0431\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u043e \u0441\u043d\u0438\u0437\u0443 \u0435\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0430 \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. (\u0412 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445 Ubuntu \u0438 Debian \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b, \u0442\u0430\u043a \u0447\u0442\u043e: sudo apt-get install mysql-proxy)<br \/>  <img decoding=\"async\" src=\"http:\/\/makescreen.ru\/i\/db2cdba0564848190478d239c2922b.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0425\u043e\u0447\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u0432 7.9\u041c\u0431 \u0432 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 \u0432\u0445\u043e\u0434\u0438\u0442 Lua \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043e\u0441\u043d\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0430\u0440\u0445\u0438\u0432\u0430 \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0432 \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0434\u043b\u044f \u0432\u0430\u0441 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e, \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 C:\\mysql-proxy<br \/>  \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043c\u043d\u043e\u0433\u043e\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 LAMP \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Winginx, \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u0439 \u0441\u0432\u044f\u0437\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u0442\u0443\u0442: <a href=\"http:\/\/winginx.ru\/\">winginx.ru\/<\/a><br \/>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e MySQL \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 3306 \u043f\u043e\u0440\u0442\u0443, \u0435\u0433\u043e \u043c\u044b \u0442\u0440\u043e\u0433\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c.<br \/>  \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f php \u043a \u0431\u0430\u0437\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c php.ini<br \/>  \u041d\u0430\u0439\u0434\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u00abmysql.default_port\u00bb \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u043e\u0440\u0442 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 4040). \u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u0438 \u00abmysqli.default_port\u00bb \u043d\u0430 4040<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/makescreen.ru\/ii\/d2ac3aa33df9a5f7507877e4d7824b.jpg\" alt=\"image\"\/><\/p>\n<p>  \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430, \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0434\u0435\u043b\u0443.<\/p>\n<h5>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 1. \u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/h5>\n<p>  \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Lua \u0441\u043a\u0440\u0438\u043f\u0442. \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b Lua \u0438\u0434\u0435\u0442 \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043d\u0435 \u043d\u0430\u0434\u043e.<br \/>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 view.lua \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 C:\\mysql-proxy\\ \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><code class=\"lua\">function read_query(packet)    if string.byte(packet) == proxy.COM_QUERY then \tprint(string.sub(packet, 2))    end end <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<br \/>  \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 C:\\mysql-proxy \u0444\u0430\u0439\u043b view.bat c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><code class=\"bash\">C:\\mysql-proxy\\bin\\mysql-proxy.exe --proxy-lua-script=C:\\mysql-proxy\\view.lua --log-file=&quot;C:\\mysql-proxy\\mysql-proxy-log.txt&quot; --proxy-backend-addresses=localhost:3306 <\/code><\/pre>\n<p>  &#8212;proxy-backend-addresses \u2014 \u0430\u0434\u0440\u0435\u0441 MySQL \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0441\u043a\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u0432\u044d\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u0430\u043a\u0438\u0435 \u043b\u0438\u0431\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0431\u0430\u0437\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0442\u0430\u043a\u043e\u0435:<br \/>  <img decoding=\"async\" src=\"http:\/\/makescreen.ru\/ii\/1ebf2078f3ceb4bf5cabaea18ac84c.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0417\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f, \u0445\u043e\u0440\u043e\u0448\u043e.<\/p>\n<h5>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 2. \u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0444\u0430\u0439\u043b.<\/h5>\n<p>  \u0414\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u0442\u0430\u0442\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Lua.<br \/>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b view-write.lua \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 C:\\mysql-proxy\\ \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><code class=\"lua\">function read_query(packet)    if string.byte(packet) == proxy.COM_QUERY then \tlocal file = io.open(&quot;C:\\\\mysql-proxy\\\\sql-log.txt&quot;, &quot;a&quot;) \tfile:write(string.sub(packet, 2) .. &quot;\\n&quot;) \tfile:close() \tprint(string.sub(packet, 2))    end end <\/code><\/pre>\n<p>  \u0438 bat \u0444\u0430\u0439\u043b \u2014 \u00abview-write.bat\u00bb  <\/p>\n<pre><code class=\"bash\">C:\\mysql-proxy\\bin\\mysql-proxy.exe --proxy-lua-script=&quot;C:\\mysql-proxy\\view-write.lua&quot; --log-file=&quot;C:\\mysql-proxy\\mysql-proxy-log.txt&quot; --proxy-backend-addresses=localhost:3306 <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (\u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 \u00abC:\\mysql-proxy\\sql-log.txt\u00bb)<br \/>  <img decoding=\"async\" src=\"http:\/\/makescreen.ru\/ii\/b2a44166c54680f18029c2bddf5267.jpg\" alt=\"image\"\/><\/p>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u0430\u043c\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043d\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0432\u044b\u0432\u043e\u0434 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u044d\u0442\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<h5>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 3. \u0417\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h5>\n<p>  \u041f\u043e \u0442\u043e\u0439-\u0436\u0435 \u0441\u0445\u0435\u043c\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u00abview-result.lua\u00bb:  <\/p>\n<pre><code class=\"lua\">function read_query( packet )         if packet:byte() == proxy.COM_QUERY then \t\t\t\tprint(&quot;Query: &quot; .. string.sub(packet, 2)) \t\t\t\tlocal file = io.open(&quot;C:\\\\mysql-proxy\\\\sql-log.txt&quot;, &quot;a&quot;) \t\t\t\tfile:write(&quot;Query: &quot; .. string.sub(packet, 2) .. &quot;\\n&quot;) \t\t\t\tfile:close()                 proxy.queries:append(2, string.char(proxy.COM_QUERY) .. string.sub(packet, 2), {resultset_is_needed = true} )                 proxy.queries:append(1, packet, {resultset_is_needed = true})                 return proxy.PROXY_SEND_QUERY         end end function read_query_result(inj)         if inj.id == 1 then \t\t\t\tfor row in inj.resultset.rows do \t\t\t\t\t\tlocal i = 1 \t\t\t\t\t\tlocal fields = {} \t\t\t\t\t\twhile row[i] do \t\t\t\t\t\t\tif row[i] == row then break end \t\t\t\t\t\t\tlocal file = io.open(&quot;C:\\\\mysql-proxy\\\\sql-log.txt&quot;, &quot;a&quot;) \t\t\t\t\t\t\tfile:write(&quot;Response field: &quot; .. inj.resultset.fields[i].name .. &quot; =&gt; &quot; .. row[i] .. &quot;\\n&quot;) \t\t\t\t\t\t\tfile:close() \t\t\t\t\t\t\tprint(&quot;Response field: &quot; .. inj.resultset.fields[i].name .. &quot; =&gt; &quot; .. row[i]) \t\t\t\t\t\t\ti = i + 1 \t\t\t\t\t\tend                 end                 return proxy.PROXY_IGNORE_RESULT         end end <\/code><\/pre>\n<p>  \u0418 view-result.bat  <\/p>\n<pre><code class=\"bash\">C:\\mysql-proxy\\bin\\mysql-proxy.exe --proxy-lua-script=&quot;C:\\mysql-proxy\\view-result.lua&quot; --log-file=&quot;C:\\mysql-proxy\\mysql-proxy-log.txt&quot; --proxy-backend-addresses=localhost:3306 <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u043b\u043d\u043e\u0435 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0432 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u043c \u0432\u0438\u0434\u0435<br \/>  <img decoding=\"async\" src=\"http:\/\/makescreen.ru\/screen\/4aeea4ca3458602866196f02437b50\" alt=\"image\"\/>    \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/177057\/\"> http:\/\/habrahabr.ru\/post\/177057\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u044f\u0441\u044c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430 \u0438\u043b\u0438 \u0438\u043d\u0430\u044f CMS \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u044e\u0449\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0443. <br \/>  \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0442\u0435\u043c\u0430 \u2014 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u0430\u0437(\u043e\u0439|\u0430\u043c\u0438) \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0435. \u0427\u0442\u043e-\u0442\u043e, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u043a\u0430\u043a \u0441 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c \u0434\u0432\u0438\u0436\u043a\u043e\u043c, \u0442\u0430\u043a \u0438 \u0441 \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439.<br \/>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0443 \u0432\u0430\u0441 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u043e\u043c \u0438 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u043b\u0438 \u0441\u043c\u0435\u043d\u0430 \u043f\u0430\u0440\u043e\u043b\u0435\u0439.<\/p>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0445 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0411\u0414 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043b\u0430\u0442\u043d\u044b\u043c\u0438 [<a href=\"https:\/\/www.webyog.com\/product\/sqlyog\">\u0440\u0430\u0437<\/a>, <a href=\"http:\/\/www.nagios.com\/solutions\/mysql-monitoring\">\u0434\u0432\u0430<\/a>]. \u042f \u0445\u043e\u0442\u0435\u043b \u0447\u0442\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043b\u0435\u0433\u043a\u043e\u0435 \u0438 \u0443\u0434\u043e\u0431\u043d\u043e\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u0431\u0440\u0430\u043b mysql-proxy. \u0425\u043e\u0442\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0448\u0438\u0440\u0435 \u0447\u0435\u043c \u043c\u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u044f \u043e\u043f\u0438\u0448\u0443 \u043b\u0438\u0448\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043f\u043e\u0434 Windows, \u0442\u0430\u043a \u0438 \u043f\u043e\u0434 Unix \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-177057","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/177057","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=177057"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/177057\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=177057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=177057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=177057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}