Connecting mysql server inside vagrant VM via php (for JasperPHP use)

Hello!

I’m pretty new to php development, so i started using this pretty handy book by Bruno Skvorc: Jumpstart PHP environment. I was ablr to set and configure my environment and start developing. Everything was working like a charm until the need arose to create reports. All the options i checked required the installation of server or the establishments of communication bridges, and all that was against the very idea of deploying an environment like the one described in the book.

Then i stumbled with this fantastic library by github user cossou, called jasperphp (https://github.com/cossou/JasperPHP). It was simple, lightweight and right out of the box usable. But then i needed to connect to a mysql DB so i could iterate through records to fill tables and such for the reports, and this nightmare began.

For now, suffice to say that JasperPHP uses jasperstarter, a tool that allows us to compile and process Jasper reports via command line. When i try to put together a command inside my local VM (meaning, in vagrant) to process a dummy report, everything goes smooth. The command is executed and the report processed and saved in pdf format.

But when i add some commands to connect to my DB using the required JDBC (so i can process a dummy report), all i get is the following error:

I’m totally lost, since this seems to be a cryptic error, caused by a wide variety of reasons and for which i couldn’t really find any useful information. I hope you can help me figure it out. If you need any additional info regarding connection strings or server configuration, please let me know,

Also, i contacted cossou (the author of JasperPHP) and at this point i don’t think he really could help me, since this seems to be out of the scope of his library.

Any tip, clue, or advice is appreciated. Thanks in advance!

Also, if you know of any alternative for generating reports that has good synergy with the development paradigm described in Bruno Skvorc, please let me know!

Looks like the loaded driver is deprecated. The message Loading class 'com.mysql.jdbc.Driver'. This is deprecated is warning you that you need to use the up to date driver. Try to connect using the newer driver, and inside your vm edit the file /etc/mysql/my.conf and comment the following line bind-address = 127.0.0.1

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.