From 40e2ca86f096159b751b73e7b51233ce3f62bbb0 Mon Sep 17 00:00:00 2001 From: Tom Keffer Date: Thu, 25 Jun 2015 16:12:59 -0700 Subject: [PATCH] Updated to reflect new way of configuring the databases. --- docs/usersguide.htm | 137 +++++++++++++++++++++++++++----------------- 1 file changed, 86 insertions(+), 51 deletions(-) diff --git a/docs/usersguide.htm b/docs/usersguide.htm index 4accaa9d..2f86b296 100644 --- a/docs/usersguide.htm +++ b/docs/usersguide.htm @@ -2312,7 +2312,9 @@ longitude = -77.0366 The actual database to be used — it should match one of the sections in [Databases]. Should you decide to use a MySQL database, instead of the default - SQLite database, this is the place to change it. Required. + SQLite database, this is the place to change it. See the + section Configuring MySQL + for details. Required.

table_name

@@ -2348,54 +2350,88 @@ longitude = -77.0366

This definition uses the SQLite database engine to store data. SQLite is open-source, simple, lightweight, highly portable, and memory efficient. For most purposes it serves nicely.

-

root

-

The root directory from which relative paths descend. Default is - the WEEWX_ROOT directory.

+

database_type

+

Set to SQLite to signal that this is a + SQLite database.

database_name

-

The name of the SQLite file. A path can also be specified with the name. - A relative path is relative to the root - parameter. Default is archive/weewx.sdb for - setup.py installations or - /var/lib/weewx/weewx.sdb for DEB or RPM - installations.

-

timeout

-

When the database is accessed by multiple threads and one of those threads - modifies the database, the SQLite database is locked until that transaction - is completed. The timeout option specifies how long - other threads should wait for the lock to go away before raising an exception. - The default is 5 seconds.

-

isolation_level

-

Set the current isolation level. See the pysqlite documentation on - - isolation levels for more information. There is no reason - to change this, but it is here for completeness. Default is None - (autocommit).

+

The path to the SQLite file relative to the SQLITE_ROOT + option. Default is weewx.sdb.

[[archive_mysql]]

This definition uses the MySQL database engine to store data. It is free, highly-scalable, but more complicated to administer.

-

Note that if you choose the MySQL - database it is assumed that you know how to administer it. In particular, - you will have to set up a user with appropriate create and modify - privileges.

-

host

-

The name of the server on which the database is located. Default is localhost.

-

user

-

The user name to be used to log into the server. Required.

-

password

-

The password. Required.

+

database_type

+

Set to MySQL to signal that this is a + MySQL database.

database_name

-

The name of the database. Required.

+

The name of the database. Default is weewx. + Required.

-

[Engines]

-

This section is used to configure the internal service engine in - weewx. It is for advanced customization. Details on - how to do this can be found in the section - Customizing the - weewx service engine of the Customizing Guide.

+

[SQLite]

+

This section defines default values for SQLite databases. + They can be overridden by individual databases.

+ +

driver

+

+ The sqlite driver name. Required. +

+

SQLITE_ROOT

+

+ The location of the directory holding the SQLite databases. For setup.py installations, the default is the WEEWX_ROOT/archive + directory. For DEB or RPM installations, it is /var/lib/weewx. +

+

timeout

+

+ When the database is accessed by multiple threads and one of those + threads modifies the database, the SQLite database is locked until + that transaction is completed. The timeout + option specifies how long other threads should wait for the lock to + go away before raising an exception. The default is 5 seconds. +

+

isolation_level

+

+ Set the current isolation level. See the pysqlite documentation on + isolation levels for more information. There is no reason to change + this, but it is here for completeness. Default is None + (autocommit). +

+ +

[MySQL]

+

This section defines default values for MySQL databases. They + can be overridden by individual databases.

+

+ Note that if you choose the MySQL + database, it is assumed that you know how to administer it. In + particular, you will have to set up a user with appropriate create + and modify privileges. +

+

driver

+

The MySQL driver name. Required.

+

host

+

+ The name of the server on which the database is located. Default is localhost. +

+

user

+

The user name to be used to log into the server. Required.

+

password

+

The password. Required.

+ +

[Engines]

+

+ This section is used to configure the internal service engine in weewx. It is for advanced customization. Details + on how to do this can be found in the section Customizing the weewx + service engine of the Customizing + Guide. +

-

[[Services]]

+

[[Services]]

Internally, weewx consists of many services, each responsible for some aspect of the program's functionality. @@ -3189,7 +3225,9 @@ wind_gust_max_time: None

database, instead of the default SQLite database.

First, you should change your [[wx_binding]] - section to point to MySQL, instead of SQLite. After the change, it + section to point to the MySQL database, archive_mysql, + instead of the SQLite database archive_sqlite. After the + change, it will look something like this (change highlighted):

@@ -3204,16 +3242,13 @@ wind_gust_max_time: None

schema = schemas.wview.schema

Assuming that you want to use the default database configuration, your - [Databases] section - should - look something like this:

-
[Databases]
-  [[archive_mysql]]
-      host = localhost
-      user = weewx
-      password = weewx
-      database_name = weewx
-      driver = weedb.mysql
+      [MySQL] section 
+      should look something like this:

+
[MySQL]
+    driver = weedb.mysql
+    host = localhost
+    user = weewx
+    password = weewx
 

This assumes user weewx would have password weewx. Adjust as necessary.