MyphpSQL/WD Database

Morning. I’m clueless with database applications (and many other things). I use WD with MAMP/MySQL to run a localhost website (need to understand what I’m doing before I put it on my NAS). I wanted to ask if there is a way of extracting data from the MAMP SQL database into other software (perhaps such as MS Access) without getting a degree in Computer Science? The export of a csv file seems obvious but I was hoping to find a way of reading the data in the database without manually creating and importing a csv to Access. Trying to get the right OBDC driver installed in Access is foxing me. Maybe a direct read of a file from WD into Access or Excel would be easier? Not sure what file to use if that is the solution. If a WD file is the answer which one would be the “forever” file if it exists.

Thanks

Stuart

I’ve not done that kind of thing for many years but as far as I recall the only way to do it was by using an ODBC connection.

Why do you need the data in Access/Excel? Your goal seems to suggest you’re testing your website before making it public. I’d have thought that having data in a MySQL database would have been more useful for doing that than having it in Access or Excel?

Hi, thanks for the reply. The website is basically working and I can now post it once I’ve configured the NAS properly.

I was playing around with trying to graph all history data, or periodic data extending beyond a month and I was hoping the easiest would be a database query. myphpSQL is a bit finicky with that. I could import straight to Excel but there does not seem to be a single text file in WD that accumulates data beyond a month.

WD operates with text files and as some of us have over 20 years of data in WD format a single text file containing all that data would be huge and slow to process. So at a basic level all you’ve got is the monthly logs text files to use. You could probably write a script in Access to find the files and then import them one by one into an Access table.

The text file size issue is why WD can also export into MySQL. So that you can put all the data in a database which is designed to allow querying of large volumes of data.

As a one-off export then CSV is probably the easiest way to get the MySQL data into Access or Excel. If you want to do this repeatedly then I think your only option is to figure out the ODBC connection string so that you can always get the latest data from the database.

I don’t know of myphpSQL, but there are other ways of graphing MySQL data in PHP. For example, you’ll see examples in the forum of people using JpGraph. I’m pretty sure there are examples of some charts using WD data too. Maybe that’s worth investigating?

Thank you Sir. I’ll look for the posts on JPGraph.

G’morning. After much head banging I managed to get everything to work, mySQL, with OBDC exports to Access and Excel. Rather pleased with myself and thanks for your help. Still haven’t posted my website but it’s coming soon I hope (the NAS is another challenge entirely)

I have the curiosity of a cat and I was wondering if there is a way of using WD with PostgreSQL? I’m sure there are any number of ways to link a mySQL db to a Postgre db but I was looking more at a direct export of data to Postgre.

Thanks

Stuart

Well done on getting things working. I know I’ve battled with ODBC connections in the past (not with WD though) but it’s too many years ago now to recall any hints and tips that might have helped you.

I’m pretty sure that there isn’t a direct way to get data into PostgreSQL. I think people have written log file parsers in the past to get data into unsupported databases. Whether that’s worth it depends on how important it is to you to get it into PGSQL.

I’m assuming you know PGSQL well? A lot of weather scripts use MySQL and I can’t immediately think of any that use PGSQL.