remote access to mysql [SOLVED]

I am trying to access mysql from my windows computer in my homenetwork. I can do it with MySql Workbench using SSH. Is there a way I can do it directly?

My goal is to be able to import the tables in Excel.

note: I am a newbee so I am on a steep learning curve. 

Peter Galbavy's picture

Re: remote access to mysql [SOLVED]

If you can use the SSH transport/tunnel from MySQL WB then you continue doing that - WB allows saving queries as CSV if you don't mind the manual process.

You can do more generic SSH tunnelling using PuTTY on Windows, but that may get more complicated if you haven't played with it for other protocols before.

Providing native external access to MySQL is probably not for the faint hearted or for those who care about their data security (the default is no encryption on port 3306). That said, the basics (non emonpi/emoncms specific) are to enable it in the my.cnf file and then allow user access to resources. The "users" are different as access is based on GRANTS and not users per se.

See https://stackoverflow.com/questions/14779104/how-to-allow-remote-connection-to-mysql as a starting point and then nhttps://dev.mysql.com/doc/refman/5.0/en/ssl-connections.html for SSL encryption.

larsthiesson's picture

Re: remote access to mysql [SOLVED]

Thanks for the reply. I was not trying to do a external acccess. Only access to computeres behind the firewall of my access point. I have granted priviliges, set bind-adress to 0.0.0.0, restartede mysql. I did a portscan of my Emonbase (raspberry) and it seem that 3306 is not an open port. How do open it? I think its not my access point (but I am not sure).

I also found out that the data I am looking for is not in the emoncms database i MySQL. Where is it then?

The data I am looking for is the logged feeds (e.g. measured temperature and humidity and when it was measured).

Bra1n's picture

Re: remote access to mysql [SOLVED]

You need the mysql odbc driver and then it's easy. A Google search should reveal all.

Bill Thomson's picture

Re: remote access to mysql [SOLVED]

The data I am looking for is the logged feeds (e.g. measured temperature and humidity and when it was measured).

Your data should be in

/var/lib/phpfiwa

or

/var/lib/phpfina

or

/var/lib/phptimeseries

depending on the engine you chose when you set up your inputs.

 

Bra1n's picture

Re: remote access to mysql [SOLVED]

What about using the csv export option on the feeds page, it's the little down arrow in the rightmost column, then just load the saved csv file into excel .... simples ;)

larsthiesson's picture

Re: remote access to mysql [SOLVED]

I do not have the libraries:

/var/lib/phpfiwa, /var/lib/phpfina, /var/lib/phptimeseries

​Can it be that I have a Emonbase - and then its somewere else?

I can now access the emoncms via Workbench and SSH, but I can not get Raspberry to respond without SSH. 

Downloading the csv file into excel will not do it. I am monitoring my district heating, electricity, water and for example in order to compare the use of heat I need to "normalize" it with the temperature outside (and even allow for at some of the heat is used for hot water and therefor not dependent on outside temperature). I would like to look at it on a daily basis, so csv is not an option. 

And I cant get the emoncms to do simple things like showing my water use based on logging 1liter/puls input. Se attachment.

So I concluded I needed to get the data into something i understand - like execl.

 

Bra1n's picture

Re: remote access to mysql [SOLVED]

What version of emoncms are you using ? (it's displayed at the very bottom of each webpage)

larsthiesson's picture

Re: remote access to mysql [SOLVED]

low-write-v8.5

Bra1n's picture

Re: remote access to mysql [SOLVED]

You could use the feed api to retrieve data into excel although some coding would be required to translate the json retrieved and put into cells although maybe there's something here you can use http://ramblings.mcpher.com/Home/excelquirks/json

larsthiesson's picture

Re: remote access to mysql [SOLVED]

I have gained access "direct" to MySQL by following this guide (https://stackoverflow.com/questions/14779104/how-to-allow-remote-connect...). I was missing the iptables command in the end. But now its working.

1.

Bill Thomson's picture

Re: remote access to mysql [SOLVED]

note: I am a newbee so I am on a steep learning curve. 

I was missing the iptables command in the end. But now its working.

You didn't mention you were running the Linux firewall "iptables."

Perhaps, as a newbie, you weren't aware of the firewall?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.