Sql to Mysql

103 views
Skip to first unread message

Andre Rieth

unread,
Jul 13, 2015, 1:19:14 AM7/13/15
to weewx...@googlegroups.com
hello

I would like to store the SQL data in a MySQL database .
The server is reachable but on another network via the Internet .
Is there a way the data 1 or 2 times per day to secure ?

Yours sincerely

Andre

Thomas Keffer

unread,
Jul 13, 2015, 9:15:45 AM7/13/15
to weewx-user
Hello, Andre

Your question is unclear. 

Are you trying to use a MySQL database server locally, but want to back it up to another, remote, server?

-tk

--
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 weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andre Rieth

unread,
Jul 13, 2015, 9:37:22 AM7/13/15
to weewx...@googlegroups.com
hello
I would like to failures of the memory card and the data loss prevention to an external server , the data still store .
I always want to store a backup copy on the external server in the MySQL Database . I hope that it is possible .




André

Thomas Keffer

unread,
Jul 13, 2015, 9:50:30 AM7/13/15
to weewx-user
There are many ways of doing this. The simplest is to use the utility mysqldump to dump the SQL data to a file. Then FTP it to your external server.

See the MySQL manual for help on how to backup a MySQL database.

-tk

--

Andre Rieth

unread,
Jul 16, 2015, 3:21:52 AM7/16/15
to weewx...@googlegroups.com
Hello
I'm trying to save the data of Wetterstaion in the previously installed MySQL.
In the config I have under DataBindings [[wx_binding]]
        # The database must match one of the sections in [Databases]
        #Database = archive_sqlite
          database = archive_mysql
changed.

Unfortunately, I get this message.
root @ raspberrypi: ~ # sudo tail -f / var / log / syslog
July 16 09:17:10 raspberrypi weewx [4497]: **** File "/usr/share/weewx/weewx/manager.py", line 915, in open_manager July 16 09:17:10 raspberrypi weewx [4497]: **** manager_dict ['schema']) July 16 09:17:10 raspberrypi weewx [4497]: **** File "/usr/share/weewx/weewx/manager.py", line 126, in open_with_create July 16 09:17:10 raspberrypi weewx [4497]: **** connection = weedb.connect (database_dict) July 16 09:17:10 raspberrypi weewx [4497]: **** File "/usr/share/weewx/weedb/__init__.py", line 62, in connect July 16 09:17:10 raspberrypi weewx [4497]: **** __import __ (db_dict ['driver']) July 16 09:17:10 raspberrypi weewx [4497]: **** File "/usr/share/weewx/weedb/mysql.py", line 12, in <module> July 16 09:17:10 raspberrypi weewx [4497]: **** import MySQLdb July 16 09:17:10 raspberrypi weewx [4497]: **** Import Error: No module named MySQLdb July 16 09:17:10 raspberrypi weewx [4497]: **** Exiting.

User name and password correct.
Database is weewx. Would be glad if someone could help.

Yours sincerely André


Am Montag, 13. Juli 2015 07:19:14 UTC+2 schrieb Andre Rieth:

Thomas Keffer

unread,
Jul 16, 2015, 8:39:12 AM7/16/15
to weewx-user
You need to install the client interfaces to MySQL. 

sudo apt-get install mysql-client
sudo apt-get install python-mysqldb

Normally this is done by the Debian installer. Not sure why that did not happen. Perhaps because you switched databases?

-tk

--

Andre Rieth

unread,
Jul 17, 2015, 4:30:16 AM7/17/15
to weewx...@googlegroups.com
Hello Tom

Many thanks for the help.
I have performed the installation.

sudo apt-get install mysql-client

sudo apt-get install python-MySQLdb

After that, I switched back to the config mysql.
Then the database was filled.

When I reboot the Raspberry comes a note on update of mysql.
Can I ignore? (Annex)

after I made the update to 3.2.0 is forecast and no longer cmon.
is that in connection with the update, or do I have to reinstall it?

Yours sincerely

Andre




Am Montag, 13. Juli 2015 07:19:14 UTC+2 schrieb Andre Rieth:

Andre Rieth

unread,
Jul 17, 2015, 4:32:55 AM7/17/15
to weewx...@googlegroups.com
Anhang


Am Montag, 13. Juli 2015 07:19:14 UTC+2 schrieb Andre Rieth:
mqsql.PNG

Jarmo Seppänen

unread,
Jul 17, 2015, 5:16:54 AM7/17/15
to weewx...@googlegroups.com
Hi,

You can safely ignore the message.

jaMO

Andre Rieth

unread,
Jul 17, 2015, 5:27:17 AM7/17/15
to weewx...@googlegroups.com
Thank you for your quick response


Am Montag, 13. Juli 2015 07:19:14 UTC+2 schrieb Andre Rieth:

Andre Rieth

unread,
Jul 17, 2015, 11:20:50 AM7/17/15
to weewx...@googlegroups.com
hello

I have now also created databases for forcast and cmon.

How can I make this again then integrated into the weather page?
I have the problem that is the database type and path is not recognized.
Do I need to make changes in the forecast.py?

Here are the config Settings


[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

 

[[forecast_binding]]

database = forecast_mysql

 

[[cmon_binding]]

database = cmon_mysql

table_name = archive

manager = weewx.manager.DaySummaryManager

schema = user.cmon.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

 

[[forecast_sqlite]]

#root = %(WEEWX_ROOT)s

root =

database_name = archive/forecast.sdb

driver = weedb.sqlite

# MySQL

[[forecast_mysql]]

database_type = MySQL

database_name = forecast

 

 

 

[[cmon_sqlite]]

root =

database_name = archive/cmon.sdb

driver = weedb.sqlite

# MySQL

[[cmon_mysql]]

database_type = MySQL

database_name = cmon

 

 

 

##############################################################################


Yours sincerely

Andre


Am Montag, 13. Juli 2015 07:19:14 UTC+2 schrieb Andre Rieth:

Andre Rieth

unread,
Jul 17, 2015, 11:44:10 AM7/17/15
to weewx...@googlegroups.com

hello

So far as I cmon runs the so see .
only forecast makes problems .
Annexed I once an error image .

I hope you can help me .

I 've also tried the MySqlDumper from .
Either the Raspberry is too weak or I did something wrong .
when I start Backup is then nothing more and the weather are no longer shared .

Am Montag, 13. Juli 2015 07:19:14 UTC+2 schrieb Andre Rieth:
forecast.PNG
Reply all
Reply to author
Forward
0 new messages