title: Erlang failing to connect to mysql/mariadb
body: <p>I cannot connect to mysql/mariadb with erlang.</p>
  <p>The requirements according to this github-page:
  <a href="https://github.com/mysql-otp/mysql-otp" rel="nofollow noreferrer">https://github.com/mysql-otp/mysql-otp</a></p>
  <p>Requirements:</p>
  <pre><code>Erlang/OTP version R16B or later
  MySQL database version 4.1 or later or MariaDB
  GNU Make or Rebar or any other tool for building Erlang/OTP applications
  </code></pre>
  <p>Version:</p>
  <pre><code>14&gt; erlang:system_info(otp_release).
  &quot;22&quot;
  </code></pre>
  <p>I'm not sure if this requirement is needed anymore but I added this:</p>
  <p><code>[mysqld] default_authentication_plugin=mysql_native_password</code></p>
  <p>to my /etc/my.cnf. But this is probably irrelevant since the error is an undefined function.
  I can compile the code but I cannot run it. Any help to get this working is much appreciated.</p>
  <p>The code:</p>
  <pre><code>-module(mydatabase).
  -compile(export_all).
  
  connect_to_database() -&gt; 
  Conn = mysql:start_link([{host, &quot;localhost&quot;}, {user, &quot;user&quot;},
                         {password, &quot;password&quot;}, {database, &quot;MyDatabase&quot;}]) ,
             
    case Conn of
        {ok, Pid} -&gt; io:fwrite(&quot;~w~w~n&quot;, [ok,Pid]);
        {error, ConnErr}  -&gt; io:fwrite(&quot;error : ~p ~n&quot;, [ConnErr])
      end.
                
   start() -&gt; connect_to_database().
  </code></pre>
  <p>mariadb is running:</p>
  <pre><code>sudo systemctl status mariadb
  [sudo] password for user: 
  ● mariadb.service - MariaDB 10.4.13 database server
     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor &gt;
     Active: active (running) since Sun 2020-06-28 15:33:50 CEST; 1h 4min ago
  </code></pre>
  <p>The error message:</p>
  <pre><code>12&gt; c(mydatabase).     
  mydatabase.erl:2: Warning: export_all flag enabled - all functions will be exported
  {ok,mydatabase}
  13&gt; mydatabase:start().
  ** exception error: undefined function mysql:start_link/1
   in function  mydatabase:connect_to_database/0 (mydatabase.erl, line 1
  </code></pre>