Which platform are you using?

Looks like you did some kind of non-standard install of WeeWX, which is
fine. I doubt it is the problem.

However, how did you install the mysql driver?

-tk

On Sat, Feb 29, 2020 at 12:06 PM Cat22 <[email protected]> wrote:

> Hi,
> weewx 3.9.2
>   I am adding the mysql capability to my weewx install and having some
> trouble getting it going. (sqlite is working though)
> I have verified the username and password work ok from a command prompt
> and the table(s) are there imported from a previous system and they are
> readable
> The issue sems to be the proper python files but I have installed what
> looked right (I am on openSuse Tumbleweed x86_64)
> TIA
> Cat22
> Here is the relevant parts of my weewx.conf:
>
> #   This section binds a data store to a database.
>
> [DataBindings]
>
>     [[wx_binding]]
>         # The database must match one of the sections in [Databases].
>         # This is likely to be the only option you would want to change.
>         #database = archive_sqlite
>         database = archive_mysql
>         # The name of the table within the database
>         table_name = archive
>         # The manager handles aggregation of data for historical summaries
>         manager = weewx.wxmanager.WXDaySummaryManager
>         # The schema defines the structure of the database.
>         # It is *only* used when the database is created.
>         schema = schemas.wview.schema
>
>
> ##############################################################################
>
> #   This section defines various databases.
>
> [Databases]
>
>     # A SQLite database is simply a single file
>     [[archive_sqlite]]
>         database_type = SQLite
>         database_name = weewx.sdb
>
>     # MySQL
>     [[archive_mysql]]
>         database_type = MySQL
>         database_name = weewx
>
>
> ##############################################################################
>
> #   This section defines defaults for the different types of databases.
>
> [DatabaseTypes]
>
>     # Defaults for SQLite databases
>     [[SQLite]]
>         driver = weedb.sqlite
>         # Directory in which the database files are located
>         SQLITE_ROOT = %(WEEWX_ROOT)s/archive
>
>     # Defaults for MySQL databases
>     [[MySQL]]
>         driver = weedb.mysql
>         # The host where the database is located
>         host = localhost
>         # The user name for logging in to the host
>         user = <user>
>         # The password for the user name
>         password = <password>
>
>
>
> And here is the error from journalctl:
>
>  engine: Using Python 2.7.17 (default, Oct 24 2019, 12:43:41) [GCC]
>  engine: Platform Linux-5.4.14-x86_64-with-glibc2.2.5
>  engine: Locale is 'en_US.UTF-8'
>  engine: Using configuration file /usr/local/bin/weewx/weewx.conf
>  engine: Loading station type Vantage (weewx.drivers.vantage)
>  engine: StdConvert target unit is 0x1
>  wxcalculate: The following values will be calculated: barometer=
> prefer_hardware, windchill=prefer_hardware, dewpoint=prefer_hardware,
> appTemp=prefer_hardware, rainRate=prefer_hardware, windrun=prefer_hardware
> , heatindex=prefer_hardware>
>  wxcalculate: The following algorithms will be used for calculations:
> altimeter=aaNOAA, maxSolarRad=RS
>  engine: Archive will use data binding wx_binding
>  engine: Record generation will be attempted in 'hardware'
>  engine: Using archive interval of 300 seconds (specified by hardware)
>  engine: Caught unrecoverable exception in engine:
>      ****  No module named _mysql_exceptions
>      ****  Traceback (most recent call last):
>      ****    File "/usr/local/bin/weewx/bin/weewx/engine.py", line 888, in
> main
>      ****      engine = engine_class(config_dict)
>      ****    File "/usr/local/bin/weewx/bin/weewx/engine.py", line 78, in
> __init__
>   Traceback (most recent call last):
>     File "/usr/local/bin/weewx/bin/weewxd", line 64, in <module>
>       weewx.engine.main(options, args)
>     File "/usr/local/bin/weewx/bin/weewx/engine.py", line 888, in main
>      ****      self.loadServices(config_dict)
>       engine = engine_class(config_dict)
>     File "/usr/local/bin/weewx/bin/weewx/engine.py", line 78, in __init__
>       self.loadServices(config_dict)
>     File "/usr/local/bin/weewx/bin/weewx/engine.py", line 142, in
> loadServices
>       self.service_obj.append(weeutil.weeutil._get_object(svc)(self,
> config_dict))
>     File "/usr/local/bin/weewx/bin/weewx/engine.py", line 500, in __init__
>       self.setup_database(config_dict)
>     File "/usr/local/bin/weewx/bin/weewx/engine.py", line 608, in
> setup_database
>      ****    File "/usr/local/bin/weewx/bin/weewx/engine.py", line 142, in
> loadServices
>       dbmanager = self.engine.db_binder.get_manager(self.data_binding,
> initialize=True)
>     File "/usr/local/bin/weewx/bin/weewx/manager.py", line 872, in
> get_manager
>       self.manager_cache[data_binding] = open_manager(manager_dict,
> initialize)
>     File "/usr/local/bin/weewx/bin/weewx/manager.py", line 1021, in
> open_manager
>      ****      self.service_obj.append(weeutil.weeutil._get_object(svc)(
> self, config_dict))
>       manager_dict['schema'])
>     File "/usr/local/bin/weewx/bin/weewx/manager.py", line 128, in
> open_with_create
>       connection = weedb.connect(database_dict)
>     File "/usr/local/bin/weewx/bin/weedb/__init__.py", line 86, in connect
>       __import__(db_dict['driver'])
>     File "/usr/local/bin/weewx/bin/weedb/mysql.py", line 11, in <module>
>       from _mysql_exceptions import DatabaseError, IntegrityError,
> ProgrammingError, OperationalError
>      ****    File "/usr/local/bin/weewx/bin/weewx/engine.py", line 500, in
> __init__
>   ImportError: No module named _mysql_exceptions
>      ****      self.setup_database(config_dict)
>      ****    File "/usr/local/bin/weewx/bin/weewx/engine.py", line 608, in
> setup_database
>      ****      dbmanager = self.engine.db_binder.get_manager(self.
> data_binding, initialize=True)
>      ****    File "/usr/local/bin/weewx/bin/weewx/manager.py", line 872,
> in get_manager
>      ****      self.manager_cache[data_binding] = open_manager(
> manager_dict, initialize)
>      ****    File "/usr/local/bin/weewx/bin/weewx/manager.py", line 1021,
> in open_manager
>      ****      manager_dict['schema'])
>      ****    File "/usr/local/bin/weewx/bin/weewx/manager.py", line 128,
> in open_with_create
>      ****      connection = weedb.connect(database_dict)
>      ****    File "/usr/local/bin/weewx/bin/weedb/__init__.py", line 86,
> in connect
>      ****      __import__(db_dict['driver'])
>      ****    File "/usr/local/bin/weewx/bin/weedb/mysql.py", line 11, in
> <module>
>      ****      from _mysql_exceptions import DatabaseError, IntegrityError
> , ProgrammingError, OperationalError
>      ****  ImportError: No module named _mysql_exceptions
>      ****  Exiting.
>  systemd[1]: weewx.service: Failed with result 'exit-code'.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/690040c1-6b18-43b6-a1f1-f34cddd45256%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/690040c1-6b18-43b6-a1f1-f34cddd45256%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zECveAs-2p8J1R0%3DEHsVLg-v2_Z3Jw-XA_gSs6VTLe9hkw%40mail.gmail.com.

Reply via email to