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

Rasbian Stretch uses MariaDB #2

Open
KalleLan opened this issue Jun 13, 2018 · 5 comments
Open

Rasbian Stretch uses MariaDB #2

KalleLan opened this issue Jun 13, 2018 · 5 comments

Comments

@KalleLan
Copy link

How to fix read_and_write_observations.py to use MariaDB since stretch is the current build for Raspberry?
Is there other fixes that needs to be implemented?

@Nrde
Copy link

Nrde commented Jun 14, 2018

Eikä MariaDB ole drop-in yhteensopiva MySql:n kanssa?

@KalleLan
Copy link
Author

KalleLan commented Jun 14, 2018

Osa komennoista ainakin tuntui olevan hiukan muuttunut. Viittaa MariaDB:hen mut ihan varma en oo. Muuten homma rokkaa, mut kannan luonnissa ja sinne sitten kirjoittamisessa on haasteita.

@Nrde
Copy link

Nrde commented Jun 14, 2018

Jos jaksat odottaa viikonlopun niin pääsen itse testaaman, käytän omissa projekteissa noita sekaisin eikä omalle kohdalle ole sattunut yhteensopimattomuuksia - mikä ei tietenkään ole tae etteikö niitä olisi.

@KalleLan
Copy link
Author

KalleLan commented Jun 15, 2018

I got it working.
Was missing mysql-connector
pip3 install mysql-connector-python

Here is what I changed in read_and_write_observations.py :

import mysql.connector as mariadb

mariadb_connection = mariadb.connect(user='writer', password='writer',  database='observations')

cursor=mariadb_connection.cursor()

mariadb_connection.commit()

mariadb_connection.close()

Saa kommentoida jos tossa on turhia osioita, mut nyt taulusta löytyy arvot ja homma rokkaa.

@Dragonius
Copy link

curs.execute ("""INSERT INTO observations
values(CURRENT_DATE(),NOW(),{},{}, {}, UNIX_TIMESTAMP())""".format(temp, pres, relhum ))

vaati myös muutamisen

cursor.execute ("""INSERT INTO observations
values(CURRENT_DATE(),NOW(),{},{}, {}, UNIX_TIMESTAMP())""".format(temp, pres, relhum ))

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

3 participants