<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><tt>Good spot, that is exactly the problem!  This issue seems to
        be more prevalent with MariaDB,<br>
        where the default database charset is "utf8mb4", and not
        "latin1" as in the MySQL packages.</tt></p>
    <p><tt>This answer[1] also includes some MariaDB server settings
        which should allow the creation<br>
        of keys on VARCHAR(255) columns even if using the utf8mb4
        charset.</tt></p>
    <tt>[1]: <a class="moz-txt-link-freetext"
        href="https://stackoverflow.com/a/36405914/2054305">https://stackoverflow.com/a/36405914/2054305</a></tt>
    <pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 18.06.2019 10:31, Callum Guy wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFjCFznsC6-pjicWSK5-1e3Vauw+8zhRs-3a_GgbCJmzGnC8Nw@mail.gmail.com">
      <div dir="ltr">Hi David,<br>
        <div><br>
        </div>
        <div>This seems to be a database collation issue - did you
          create the database manually and do you have the option to
          change the charset?</div>
        <div><br>
        </div>
        <div><a
href="https://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-767-bytes"
            moz-do-not-send="true">https://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-767-bytes</a><br>
        </div>
        <div><br>
        </div>
        <div>Not sure what the correct options would be for you however
          I am sure you can work that out :)</div>
        <div><br>
        </div>
        <div>Good luck!</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Tue, 18 Jun 2019 at 03:59,
          David Villasmil <<a
            href="mailto:david.villasmil.work@gmail.com"
            moz-do-not-send="true">david.villasmil.work@gmail.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div dir="ltr">
            <div>Hello guys,</div>
            <div><br>
            </div>
            <div>When executing `create database` with opensips-cli i'm
              getting:</div>
            <div><br>
            </div>
            <div><span style="font-family:"courier
                new",monospace">root@opensip1:~# opensips-cli</span></div>
            <div><span style="font-family:"courier
                new",monospace">mysql://opensips:<span
                  style="font-family:"courier new",monospace">password</span>@<a
                  href="http://127.0.0.1" target="_blank"
                  moz-do-not-send="true">127.0.0.1</a><br>
                Welcome to OpenSIPS Command Line Interface!<br>
                (opensips-cli): database create<br>
                Please provide us the URL of the database:
                mysql://opensips:<span style="font-family:"courier
                  new",monospace">password</span>@<a
                  href="http://127.0.0.1" target="_blank"
                  moz-do-not-send="true">127.0.0.1</a><br>
                Create [a]ll tables or just the [c]urrently configured
                ones? (Default value is a): a<br>
                Creating all tables ...<br>
                Running standard-create.sql...<br>
                Running cachedb_sql-create.sql...<br>
                ERROR: Error closing cursor<br>
                Traceback (most recent call last):<br>
                  File "/usr/lib/python3.5/cmd.py", line 214, in onecmd<br>
                    func = getattr(self, 'do_' + cmd)<br>
                AttributeError: 'OpenSIPSCLIShell' object has no
                attribute 'do_database'<br>
                <br>
                During handling of the above exception, another
                exception occurred:<br>
                <br>
                Traceback (most recent call last):<br>
                  File
"/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.3.3-py3.5-linux-x86_64.egg/sqlalchemy/engine/base.py",
                line 1333, in _safe_close_cursor<br>
                    cursor.close()<br>
                  File
                "/usr/local/lib/python3.5/dist-packages/MySQLdb/cursors.py",
                line 86, in close<br>
                    while self.nextset():<br>
                  File
                "/usr/local/lib/python3.5/dist-packages/MySQLdb/cursors.py",
                line 136, in nextset<br>
                    nr = db.next_result()<br>
                MySQLdb._exceptions.OperationalError: (1071, 'Specified
                key was too long; max key length is 767 bytes')</span></div>
          </div>
        </blockquote>
      </div>
    </blockquote>
  </body>
</html>