MySQL issues with installation
ahmad-musleh opened this issue · 2 comments
while running
python -m pinball.run_pinball -c tutorial/example_repo/tutorial.yaml -m master
I get an error:
Creating tables ...
Creating table active_tokens_NV2XG3DFNAWUQUBNINXW24DBOEWUK3DJORSS2OBTGAYC2Q2NKQ______
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in run_code
exec code in run_globals
File "/home/musleh/Documents/pinball/tmp/pinball/pinball/run_pinball.py", line 230, in
main()
File "/home/musleh/Documents/pinball/tmp/pinball/pinball/run_pinball.py", line 208, in main
factory.create_master(DbStore())
File "pinball/persistence/store.py", line 46, in init
self.initialize()
File "pinball/persistence/store.py", line 130, in initialize
management.call_command('syncdb', interactive=False)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 161, in call_command
return klass.execute(args, *defaults)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 255, in execute
output = self.handle(args, _options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 385, in handle
return self.handle_noargs(options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py", line 102, in handle_noargs
cursor.execute(statement)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 41, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 130, in execute
six.reraise(utils.DatabaseError, utils.DatabaseError(tuple(e.args)), sys.exc_info()[2])
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 120, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
self.errorhandler(self, exc, value)
File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
django.db.utils.DatabaseError: (1103, "Incorrect table name 'active_tokens_NV2XG3DFNAWUQUBNINXW24DBOEWUK3DJORSS2OBTGAYC2Q2NKQ'")
and when i created a table without the trailing underscores it worked fine.
Failed MySQL command:
mysql> create table active_tokens_NV2XG3DFNAWUQUBNINXW24DBOEWUK3DJORSS2OBTGAYC2Q2NKQ______(id int);
ERROR 1103 (42000): Incorrect table name 'active_tokens_NV2XG3DFNAWUQUBNINXW24DBOEWUK3DJORSS2OBTGAYC2Q2NKQ______'
Succesful SQL command:
mysql> create table active_tokens_NV2XG3DFNAWUQUBNINXW24DBOEWUK3DJORSS2OBTGAYC2Q2NKQ(id int);
Query OK, 0 rows affected (0.08 sec)
Mysql limit table name length to 64 characters.
the table name is calculated using base32 of the default server host name, which in some cases will result in table name too long...
one workaround is that you can change the master_name in the config file