B4J Question connect to local PhpMyadmin

hi

i have western digital my cloud device
this device have phpmyadmin app

i can connect to phpmyadmin with this address on local network http://192.168.11.2/phpMyAdmin/index.php?

how to direct connect to phpmyadmin whiteout webservice ?

i see this post but i have problem in connect with this tutorial

My Source
B4X:
#Region Project Attributes
    #MainFormWidth: 600
    #MainFormHeight: 400
    #AdditionalJar: mysql-connector-java-5.1.27-bin.jar
#End Region

Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Private sql1 As SQL
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    sql1.InitializeAsync("sql1", "com.mysql.jdbc.Driver", _
     "jdbc:http://192.168.11.2:3306/mytablename", "myuser", "mypassword") 
    MainForm.Show
End Sub


error Log
B4X:
java.sql.SQLException: No suitable driver found for jdbc:http://192.168.11.2:3306/mytablename
    at java.sql.DriverManager.getConnection(DriverManager.java:689)
    at java.sql.DriverManager.getConnection(DriverManager.java:247)
    at anywheresoftware.b4j.objects.SQL.Initialize2(SQL.java:56)
    at anywheresoftware.b4j.objects.SQL$1.call(SQL.java:90)
    at anywheresoftware.b4j.objects.SQL$1.call(SQL.java:1)
    at anywheresoftware.b4a.BA$5.run(BA.java:221)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

sorry for my bad english
 
Last edited:

inakigarm

Well-Known Member
Licensed User
Longtime User
You've to connect to MYSQL database service to work with the database directly, phpmyadmin is a frontend to access the database.

Can you post you code ? Looking at the error, seems that the mysql driver is not included in the aplication
 
Upvote 0
thank you for question

i have solved my problem with this steps

1.create new user in phpmyadmin
2.sql1.Initialize2("com.mysql.jdbc.Driver", "jdbc:mysql://192.168.11.2:3306/mydb?characterEncoding=utf8", "myuser", "mypass")
 
Upvote 0
Top