Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load application: name '_mysql' is not defined #14

Open
oonegative opened this issue Jan 17, 2022 · 1 comment
Open

Failed to load application: name '_mysql' is not defined #14

oonegative opened this issue Jan 17, 2022 · 1 comment

Comments

@oonegative
Copy link

Hi Juce, I'm trying to do a fresh install on a raspi3b+ running debian bullseye. Have been able to install all the requirements and create database but running ./servicve.sh sixserver start returns:

pi@raspberrypi:/fiveserver $ sudo mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 52
Server version: 10.0.28-MariaDB-2+b1 Raspbian testing-staging

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database fiveserver;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> create database sixserver;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> create user 'sixserver'@'%' identified by 'proevo';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant select, insert, update on sixserver.* to 'sixserver'@'%';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> use sixserver;
Database changed
MariaDB [sixserver]> source ./sql/schema6.sql
Query OK, 0 rows affected (0.28 sec)

Query OK, 0 rows affected (3.68 sec)

Query OK, 0 rows affected (0.23 sec)

Query OK, 0 rows affected (0.10 sec)

Query OK, 0 rows affected (0.11 sec)

Query OK, 0 rows affected (0.11 sec)

Query OK, 0 rows affected (0.11 sec)

Query OK, 0 rows affected (0.11 sec)

MariaDB [sixserver]> exit
Bye
pi@raspberrypi:/fiveserver $ ./service.sh sixserver start
Unhandled Error
Traceback (most recent call last):
  File "/fiveserver/.local/lib/python3.9/site-packages/twisted/application/app.py", line 676, in run
    runApp(config)
  File "/fiveserver/.local/lib/python3.9/site-packages/twisted/scripts/twistd.py", line 30, in runApp
    runner.run()
  File "/fiveserver/.local/lib/python3.9/site-packages/twisted/application/app.py", line 372, in run
    self.application = self.createOrGetApplication()
  File "/fiveserver/.local/lib/python3.9/site-packages/twisted/application/app.py", line 439, in createOrGetApplication
    application = getApplication(self.config, passphrase)
--- <exception caught here> ---
  File "/fiveserver/.local/lib/python3.9/site-packages/twisted/application/app.py", line 448, in getApplication
    application = service.loadApplication(filename, style, passphrase)
  File "/fiveserver/.local/lib/python3.9/site-packages/twisted/application/service.py", line 404, in loadApplication
    application = sob.loadValueFromFile(filename, "application")
  File "/fiveserver/.local/lib/python3.9/site-packages/twisted/persisted/sob.py", line 176, in loadValueFromFile
    eval(codeObj, d, d)
  File "./tac/sixserver.tac", line 29, in <module>
    dbConfig.getReadPool(), dbConfig.getWritePool())
  File "/fiveserver/lib/fiveserver/config.py", line 125, in getReadPool
    self._readPool = self.getWritePool()
  File "/fiveserver/lib/fiveserver/config.py", line 137, in getWritePool
    self._writePool = storagecontroller.getDbPool(self.readServers,
  File "/fiveserver/lib/fiveserver/storagecontroller.py", line 20, in getDbPool
    return [
  File "/fiveserver/lib/fiveserver/storagecontroller.py", line 21, in <listcomp>
    adbapi.ConnectionPool("MySQLdb", db=db,
  File "/fiveserver/.local/lib/python3.9/site-packages/twisted/enterprise/adbapi.py", line 201, in __init__
    self.dbapi = reflect.namedModule(dbapiName)
  File "/fiveserver/.local/lib/python3.9/site-packages/twisted/python/reflect.py", line 157, in namedModule
    topLevel = __import__(name)
  File "/fiveserver/.local/lib/python3.9/site-packages/MySQLdb/__init__.py", line 24, in <module>
    version_info, _mysql.version_info, _mysql.__file__
builtins.NameError: name '_mysql' is not defined


Failed to load application: name '_mysql' is not defined

Do you have any ideas what might have gone wrong?

@juce
Copy link
Owner

juce commented Jan 18, 2022

looks like libmysqlclient is missing. See if you can install it with apt install libmysqlclient ...
Also, some discussion and suggestions here: https://stackoverflow.com/questions/63109987/nameerror-name-mysql-is-not-defined-after-setting-change-to-mysql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants