[OpenSIPS-Users] OpenSIPS 3 - can't create database

Liviu Chircu liviu at opensips.org
Tue Jun 18 03:39:38 EDT 2019


Good spot, that is exactly the problem!  This issue seems to be more 
prevalent with MariaDB,
where the default database charset is "utf8mb4", and not "latin1" as in 
the MySQL packages.

This answer[1] also includes some MariaDB server settings which should 
allow the creation
of keys on VARCHAR(255) columns even if using the utf8mb4 charset.

[1]: https://stackoverflow.com/a/36405914/2054305

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 18.06.2019 10:31, Callum Guy wrote:
> Hi David,
>
> This seems to be a database collation issue - did you create the 
> database manually and do you have the option to change the charset?
>
> https://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-767-bytes
>
> Not sure what the correct options would be for you however I am sure 
> you can work that out :)
>
> Good luck!
>
> On Tue, 18 Jun 2019 at 03:59, David Villasmil 
> <david.villasmil.work at gmail.com 
> <mailto:david.villasmil.work at gmail.com>> wrote:
>
>     Hello guys,
>
>     When executing `create database` with opensips-cli i'm getting:
>
>     root at opensip1:~# opensips-cli
>     mysql://opensips:password@127.0.0.1 <http://127.0.0.1>
>     Welcome to OpenSIPS Command Line Interface!
>     (opensips-cli): database create
>     Please provide us the URL of the database:
>     mysql://opensips:password@127.0.0.1 <http://127.0.0.1>
>     Create [a]ll tables or just the [c]urrently configured ones?
>     (Default value is a): a
>     Creating all tables ...
>     Running standard-create.sql...
>     Running cachedb_sql-create.sql...
>     ERROR: Error closing cursor
>     Traceback (most recent call last):
>       File "/usr/lib/python3.5/cmd.py", line 214, in onecmd
>         func = getattr(self, 'do_' + cmd)
>     AttributeError: 'OpenSIPSCLIShell' object has no attribute
>     'do_database'
>
>     During handling of the above exception, another exception occurred:
>
>     Traceback (most recent call last):
>       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
>         cursor.close()
>       File
>     "/usr/local/lib/python3.5/dist-packages/MySQLdb/cursors.py", line
>     86, in close
>         while self.nextset():
>       File
>     "/usr/local/lib/python3.5/dist-packages/MySQLdb/cursors.py", line
>     136, in nextset
>         nr = db.next_result()
>     MySQLdb._exceptions.OperationalError: (1071, 'Specified key was
>     too long; max key length is 767 bytes')
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20190618/d7243bd3/attachment.html>


More information about the Users mailing list