title: Fail to move mysql's data directory
body: <p>I'm trying to move the data directory of mysql, here are my steps:</p>
  
  <ul>
  <li>use <code>show variables like 'datadir'</code> to know my <code>datadir</code> is <code>/var/lib/mysql/</code></li>
  <li><code>cd /var/lib/mysql/</code></li>
  <li><code># mv * /home/elderry/db/</code></li>
  <li><code>gvim /etc/mysql/my.cnf</code></li>
  <li>Add this line in <code>[mysqld]</code> section:
  <code>datadir = /home/elderry/db/</code></li>
  <li><p><code># systemctl start mysqld</code></p>
  
  <p><code>Job for mysqld.service failed. See 'systemctl status mysqld.service' and 'journalctl -xn' for details.</code></p></li>
  <li>Then I tried: <code>systemctl status mysqld.service</code></li>
  </ul>
  
  <p>Result:</p>
  
  <pre><code>mysqld.service - MariaDB database server
     Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled)
     Active: activating (start-post) (Result: exit-code) since Tue 2013-07-30 14:31:53 CST; 13s ago
    Process: 14174 ExecStart=/usr/bin/mysqld --pid-file=/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
    Control: 14175 (mysqld-post)
     CGroup: name=systemd:/system/mysqld.service
             └─control
               ├─14175 /bin/sh /usr/bin/mysqld-post
               └─14293 sleep 1
  
  Jul 30 14:31:53 Kanone mysqld[14174]: 130730 14:31:53 [Warning] Can't create test file /home/elderry/db/Kanone.lower-test
  Jul 30 14:31:53 Kanone mysqld[14174]: [71B blob data]
  Jul 30 14:31:53 Kanone mysqld[14174]: 130730 14:31:53 [ERROR] Aborting
  Jul 30 14:31:53 Kanone mysqld[14174]: 130730 14:31:53 [Note] /usr/bin/mysqld: Shutdown complete
  Jul 30 14:31:53 Kanone systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
  </code></pre>
  
  <ul>
  <li><p>If I want to start mysql manually: <code>mysql -u root -p</code>
  output:</p>
  
  <p><code>ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)</code></p></li>
  </ul>
  
  <p>What shoud I do for now?</p>