{"id":6306,"date":"2016-09-26T09:05:55","date_gmt":"2016-09-26T01:05:55","guid":{"rendered":"http:\/\/rmohan.com\/?p=6306"},"modified":"2016-09-26T09:05:55","modified_gmt":"2016-09-26T01:05:55","slug":"mysql-secure-installation-for-non-default-socket","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6306","title":{"rendered":"Mysql Secure Installation for non default socket."},"content":{"rendered":"<header class=\"entry-header page-header\">\n<h1 class=\"entry-title \">Mysql Secure Installation for non default socket.<\/h1>\n<\/header>\n<div class=\"entry-content\">\n<h4>SECURING MYSQL SERVER \u2013<\/h4>\n<p>mysql_secure_installation is a script useful to<\/p>\n<ul>\n<li>set root password<\/li>\n<li>disallowing root login remotely<\/li>\n<li>removing anonymous user accounts after first installation<\/li>\n<li>removing test database which can be accessed by any users<\/li>\n<\/ul>\n<p>Above script would work for default\u00a0socket location i.e\u00a0\/var\/lib\/mysql\/mysql.sock<\/p>\n<p>If the server is started with a non-default socket location, mysql_secure_installation does not consider any socket options you specify and the script would fail\u00a0(For example -&gt; mysql_secure_installation \u2013socket=\/mysql\/socket\/mysql.sock)<\/p>\n<p>We should also consider this situation in case if we need to install more than one instance of mysql on a single server.<span id=\"more-68\"><\/span><\/p>\n<p>For the secure installation\u00a0script to work for a non default socket location, we need to create a softlink\u00a0\/var\/lib\/mysql\/mysql.sock -&gt; &lt;non-default socket&gt;<\/p>\n<pre>1) ln -s \/mysql\/socket\/mysqld.sock \/var\/lib\/mysql\/mysql.sock<\/pre>\n<p>Then run\u00a0mysql_secure_installation directly<\/p>\n<pre>2) mysql_secure_installation<\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p> Mysql Secure Installation for non default socket. SECURING MYSQL SERVER \u2013 <\/p>\n<p>mysql_secure_installation is a script useful to<\/p>\n<p> set root password disallowing root login remotely removing anonymous user accounts after first installation removing test database which can be accessed by any users <\/p>\n<p>Above script would work for default socket location i.e \/var\/lib\/mysql\/mysql.sock<\/p>\n<p>If the server [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[72,16],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6306"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6306"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6306\/revisions"}],"predecessor-version":[{"id":6307,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6306\/revisions\/6307"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}