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

edit the database #60

Closed
csmithsound opened this Issue Mar 7, 2019 · 10 comments

Comments

Projects
None yet
4 participants
@csmithsound
Copy link

commented Mar 7, 2019

On initial set up the temperature was recorded at -17C when actual temperature was 4C. After a few seconds the temperature corrected.

Is there anyway i can edit the database to remove these first few readings?

screen shot 2019-03-07 at 15 55 56

@maxwellpower

This comment has been minimized.

Copy link
Member

commented Mar 7, 2019

This should do it:
mysql -u<USERNAME> -p<PASSWORD> -e "DELETE FROM acuparse.archive WHERE tempC = -17"

@csmithsound

This comment has been minimized.

Copy link
Author

commented Mar 7, 2019

great thanks, i actually realised i could just re-create the database.

@csmithsound csmithsound closed this Mar 7, 2019

@csmithsound

This comment has been minimized.

Copy link
Author

commented Mar 7, 2019

-17.8 came back after deleting and recreating. This time it wasn't there initially.

pi@raspberrypi:~ $ sudo mysql -uroot -pmypassword -e "DELETE FROM acuparse.archive WHERE tempC = -17.8”

that command
doesn't seem to work.

@mfrazzz

This comment has been minimized.

Copy link

commented Mar 7, 2019

@maxwellpower

This comment has been minimized.

Copy link
Member

commented Mar 8, 2019

Since -17.8C is a rounded 0F try running:
mysql -uroot -p<PASSWORD> -e "DELETE FROM acuparse.archive WHERE tempF = 0"

tempF is the reading received from the sensors.

@maxwellpower maxwellpower reopened this Mar 8, 2019

@maxwellpower maxwellpower self-assigned this Mar 8, 2019

@csmithsound

This comment has been minimized.

Copy link
Author

commented Mar 8, 2019

after the comand i get '>'

pi@raspberrypi:~ $ sudo mysql -uroot -pmypassword -e "DELETE FROM acuparse.archive WHERE tempC = -17.8”
'>

dosn't go back to pi@raspberrypi:~
its waiting for something from me i think?

sorry guys i'm new to this language but guess this is real basic stuff to you!

@csmithsound

This comment has been minimized.

Copy link
Author

commented Mar 13, 2019

ok so i found out that means the command is still running but i left it all day and it didn't complete.
How long should this take?
can i just delete the timeframe instead?
Low: -17.8℃ (0℉) on 7 Mar @ 17:24

@maxwellpower

This comment has been minimized.

Copy link
Member

commented Mar 13, 2019

Try
mysql -uroot -p<PASSWORD> -e "DELETE FROM acuparse.archive WHERE tempF = 0;"

@GaryKOHOHIO2

This comment has been minimized.

Copy link

commented Mar 15, 2019

csmith, I THINK you need a semi-colon at the end of sql commands. I'm inexperienced, but I frequently forget that. I just ctrl+c and paste it in with ; at the end

@csmithsound

This comment has been minimized.

Copy link
Author

commented Apr 10, 2019

this one worked. ;-)

sudo mysql -uroot -pchr1st0ph3r -e "DELETE FROM acuparse.archive WHERE tempF = 0";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.