title: Where is the BASEDIR for MySQL installed with APT on Ubuntu?
body: <p>According to the MySQL document, <a href="https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization.html" rel="nofollow noreferrer">2.10.1 Initializing the Data Directory</a>:</p>
  
  <blockquote>
    <ol>
    <li><p>Change location into the top-level directory of your MySQL installation, represented here by <code>BASEDIR</code>:</p>
    
    <p><code>shell&gt; cd BASEDIR</code></p>
    
    <p><code>BASEDIR</code> is likely to be something like <code>/usr/local/mysql</code> or <code>/usr/local</code>. The following steps assume that you have changed location to this directory.</p>
    
    <p>You will find several files and subdirectories in the <code>BASEDIR</code> directory. The most important for installation purposes is the <code>bin</code> subdirectory, which contains the server as well as client and utility programs. </p></li>
    </ol>
  </blockquote>
  
  <p>I've checked <code>/usr/local/mysql and /usr/local</code>, but neither of them contains anything related to MySQL. <code>which mysql</code> returns <code>/usr/bin/mysql</code>, but I don't think <code>/usr/bin</code> would be MySQL's base directory.</p>
  
  <p>The document says I need to create a directory called <code>mysql-files</code> under <code>BASEDIR</code>, so I want to know where to find it.</p>