{"id":740,"date":"2012-08-20T01:06:07","date_gmt":"2012-08-20T07:06:07","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=740"},"modified":"2025-04-28T05:18:52","modified_gmt":"2025-04-28T11:18:52","slug":"setting-up-mysql-remote-server","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/setting-up-mysql-remote-server\/","title":{"rendered":"Setting up MySQL remote Server"},"content":{"rendered":"<p><strong><a href=\"https:\/\/www.supportpro.com\/administration.php\">Remote server<\/a> configuration<\/strong><\/p>\n<p>1. Edit the \/etc\/my.cnf file in the remote server and add the following line somewhere under [mysqld] in the my.cnf file<br \/>\nbind-address=&lt;IP address of the remote server&gt;<br \/>\n2. Restart mysql on the server<\/p>\n<p><strong>Granting privileges for database::<\/strong><\/p>\n<p>In order to access a database &#8216;abc&#8217; on the remote server from another machine, we need to add sufficient privileges for a user in the machine from which the connection is made. i.e. from the mysql prompt ( use mysql command or mysql -u root -p to enter the prompt).<\/p>\n<p>mysql&gt; grant all privileges on abc.* to username@IP address of the machine from which the connection is to be made identified by &lt;password&gt;<\/p>\n<p>Example::<\/p>\n<p>Let us consider two machines with the following data<br \/>\nRemote server IP:: xxx.xxx.x.1<br \/>\nIp of local machine from which connections to remote database in xxx.xxx.x.1 are made:: xxx.xxx.x.100<\/p>\n<p>Edit the my.cnf file in the remote server and add the following<\/p>\n<blockquote><p>bind-address = xxx.xxx.x.1<br \/>\nanywhere under [mysqld]<\/p><\/blockquote>\n<p>Inorder to grant permissions for the user &#8216;bl&#8217; from xxx.xxx.x.100 to connect to the database &#8216;ab&#8217; in xxx.xxx.x.1 , enter the mysql prompt and type in the command<\/p>\n<blockquote><p>mysql&gt;grant all privileges for ab.* to bl@ xxx.xxx.x.100 identified by pass; (# where pass is the password)<br \/>\nmysql&gt;flush privileges;<br \/>\nmysql&gt;exit<\/p><\/blockquote>\n<p>Checking for mysql connectivity from xxx.xxx.x.100 to xxx.xxx.x.1<\/p>\n<p>Enter the command below in the machine xxx.xxx.x.100 and type in the password pass upon the prompt<br \/>\n[root@local ~]# mysql -u bl -h xxx.xxx.x.1 -p<\/p>\n<p>Inorder to specify the remote database name and location for a site software like wordpress, joomla etc. , modify the configuration file and update the details of the database along with the password and IP address of the remote server in the specified filed.<\/p>\n<p>Inorder to configure wordpress to access the database &#8216;ab&#8217; from a remote machine xxx.xxx.x.1, modify the configuation file as below<\/p>\n<blockquote><p>define(&#8216;DB_NAME&#8217;, &#8216;ab&#8217;);<br \/>\ndefine(&#8216;DB_USER&#8217;, &#8216;bl&#8217;);<br \/>\ndefine(&#8216;DB_PASSWORD&#8217;, &#8216;pass&#8217;);<br \/>\ndefine(&#8216;DB_HOST&#8217;, &#8216; xxx.xxx.x.1&#8217;);<\/p><\/blockquote>\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><\/p>\n<p style=\"text-align: center;\"><!--HubSpot Call-to-Action Code --><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><!-- [if lte IE 8]><\/p>\n\n\n\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b\"><img decoding=\"async\" id=\"hs-cta-img-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b.png\" alt=\"Server not running properly? Get A FREE Server Checkup By Expert Server Admins - $125 Value\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '9d590242-d641-4383-94b4-8cfd62f0af6b', {}); <\/script><\/span><!-- end HubSpot Call-to-Action Code --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Remote server configuration 1. Edit the \/etc\/my.cnf file in the remote server and add the following line somewhere under [mysqld] in the my.cnf file bind-address=&lt;IP address of the remote server&gt;&hellip;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[3],"tags":[],"class_list":["post-740","post","type-post","status-publish","format-standard","hentry","category-technical-articles"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=740"}],"version-history":[{"count":3,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/740\/revisions"}],"predecessor-version":[{"id":14576,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/740\/revisions\/14576"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}