MegatenFreak Active Member Licensed User Mar 4, 2020 #1 Hi. I'd appreciate any quick help please. I'm trying to connect to a mySQL database on my website. Here's the jSQL function: Code: Copy sql1.InitializeAsync("sql1", "com.mysql.cj.jdbc.Driver", "jdbc:mysql://amin-azma.com:2083/amin_lims?characterEncoding=utf8&useSSL=false", "username", "password") [username and password aren't mentioned here of course!] It used to work when on localhost, but now after a long time of waiting, I get the error: com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large (5,526,600 > 65,535). You can change this value on the server by setting the 'max_allowed_packet' variable. Please help... what is the problem? The website url and port are just as shown in my browser. How do I find where the query gets stuck??? Thank you so much in advance. Last edited: Mar 4, 2020
Hi. I'd appreciate any quick help please. I'm trying to connect to a mySQL database on my website. Here's the jSQL function: Code: Copy sql1.InitializeAsync("sql1", "com.mysql.cj.jdbc.Driver", "jdbc:mysql://amin-azma.com:2083/amin_lims?characterEncoding=utf8&useSSL=false", "username", "password") [username and password aren't mentioned here of course!] It used to work when on localhost, but now after a long time of waiting, I get the error: com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large (5,526,600 > 65,535). You can change this value on the server by setting the 'max_allowed_packet' variable. Please help... what is the problem? The website url and port are just as shown in my browser. How do I find where the query gets stuck??? Thank you so much in advance.
Erel B4X founder Staff member Licensed User Longtime User Mar 4, 2020 #2 Please use [code]code here...[/code] tags when posting code. Does it happen in the initialization step? Or after you send a query? Upvote 0
Please use [code]code here...[/code] tags when posting code. Does it happen in the initialization step? Or after you send a query?
MegatenFreak Active Member Licensed User Mar 4, 2020 #3 Erel said: Please use [code]code here...[/code] tags when posting code. Does it happen in the initialization step? Or after you send a query? Click to expand... Hi Erel. It happens in the initialization, the very first step. I can't even connect to the database. by the way, I've added my IP to the server's cpanel to allow access to the databases... If this doesn't work in the end, what should I do? I can't use jRDC because the site is not a VPS so I can't install a B4J server on it...??? Any help would be greatly appreciated Last edited: Mar 4, 2020 Upvote 0
Erel said: Please use [code]code here...[/code] tags when posting code. Does it happen in the initialization step? Or after you send a query? Click to expand... Hi Erel. It happens in the initialization, the very first step. I can't even connect to the database. by the way, I've added my IP to the server's cpanel to allow access to the databases... If this doesn't work in the end, what should I do? I can't use jRDC because the site is not a VPS so I can't install a B4J server on it...??? Any help would be greatly appreciated
Erel B4X founder Staff member Licensed User Longtime User Mar 5, 2020 #4 See this discussion: https://stackoverflow.com/questions/36459337/com-mysql-jdbc-packettoobigexception-java Might be related to a wrong password. Upvote 0
See this discussion: https://stackoverflow.com/questions/36459337/com-mysql-jdbc-packettoobigexception-java Might be related to a wrong password.
MegatenFreak Active Member Licensed User Mar 5, 2020 #5 Erel said: See this discussion: https://stackoverflow.com/questions/36459337/com-mysql-jdbc-packettoobigexception-java Might be related to a wrong password. Click to expand... Thanks Erel. I checked it out. It turns out the ultimate problem is that it is a shared cpanel host and simply doesn't allow remote database connections even if I tried. So, I resorted to another method: I wrote php code that acts as a proxy for database queries and put it on the server. Then in B4J I use httpjob to communicate with that php using json strings. I'm only worried about the security aspect though. Upvote 0
Erel said: See this discussion: https://stackoverflow.com/questions/36459337/com-mysql-jdbc-packettoobigexception-java Might be related to a wrong password. Click to expand... Thanks Erel. I checked it out. It turns out the ultimate problem is that it is a shared cpanel host and simply doesn't allow remote database connections even if I tried. So, I resorted to another method: I wrote php code that acts as a proxy for database queries and put it on the server. Then in B4J I use httpjob to communicate with that php using json strings. I'm only worried about the security aspect though.
KMatle Expert Licensed User Longtime User Mar 6, 2020 #6 Use PHP. Search the forum for it. PS: Never connect to a db directly (security issues) Upvote 0