title: MySQL remote access on Ubuntu 16.0.4
body: <p>The followings are commands which I have executed on Ubuntu.</p>
  
  <pre><code>$ mysql -u root -p
  
  mysql&gt;GRANT ALL ON my_database.* TO user@'MY_REAL_IP' IDENTIFIED BY 'passwd';
  
  $ sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
  </code></pre>
  
  <blockquote>
  <pre><code> #bind-address           = 127.0.0.1
  </code></pre>
  </blockquote>
  
  <pre><code>$ sudo ufw enable
  
  $ sudo ufw allow 3306
  
  $ service mysql restart
  </code></pre>
  
  <p>But when I use another computer on Ubuntu to access mysql on MY_REAL_IP type:</p>
  
  <pre><code>$ mysql -u user -p -h MY_REAL_IP
  </code></pre>
  
  <blockquote>
    <p>Can't connect to MySQL server on 'MY_REAL_IP' </p>
  </blockquote>
  
  <p>how to fix it? thx</p>