Connection URL of phpmyadmin

31,538

This is the connection URL for access Phpmyadmin MySql server:

Class.forName("com.mysql.jdbc.Driver");//Set driver
connection = (Connection) DriverManager.getConnection("jdbc:mysql://db_ip:3306/dbName",user_name, password);
//Get Connection

If you got below message:

#1130 - Host 'machine name' is not allowed to connect to this MySQL server

Then you need to execute below query:

   CREATE USER 'root'@'%';

   GRANT ALL PRIVILEGES ON * . * TO 'root'@'%' ;

   GRANT ALL PRIVILEGES ON `root\_%` . * TO 'root'@'%';

This query creates the root user with all privilege and password is null.

Edit:

This is the reference may help you:

https://serverfault.com/questions/89955/unable-to-connect-to-mysql-through-jdbc-connector-through-tomcat-or-externally

Share:
31,538
codeofnode
Author by

codeofnode

Day : Coding for network management software. Eve: Workout to keep my body and mind fit Night: For templist, allrounder and my other open source projects

Updated on July 05, 2022

Comments

  • codeofnode
    codeofnode almost 2 years

    Can any body help me to get the connection url of the MySQL database on the server of phpmyadmin. I want to access the database remotely.

    Please note that the database is not on my local pc hard disk.

    Thank you.

  • codeofnode
    codeofnode over 11 years
    I am using the url : jdbc:mysql://69.187.151.5:3306/DCQ But i am getting the error as i commented in my question.
  • Dhinakar
    Dhinakar over 11 years
    I think this issues arises for mysql network permission. Refer this link [cyberciti.biz/tips/…
  • codeofnode
    codeofnode over 11 years
    m sorry to ask silly question, but can u tell me where to execute the above query.. Plz reply..
  • Dhinakar
    Dhinakar over 11 years
    Open browser and type 69.187.151.5/phpmyadmin. Click SQL tag. Copy and paste this query. Click Go to run.
  • codeofnode
    codeofnode over 11 years
    i ll be back with results with actions as you said in 2 minutes.. thanks.. :)
  • codeofnode
    codeofnode over 11 years
    i have already a user with root.. and but have some password.. Then what query should i execute.. plz reply the query with password.
  • Dhinakar
    Dhinakar over 11 years
    I think no need to execute this queries for your problem. I have attached the link with the answer. Kindly refer it.
  • codeofnode
    codeofnode over 11 years
    The link is quit confusing and the answer in the link says various points to check.. i am quit sure that every thing mentioned in the answer is perfect in my situation.. but yet i am getting this error.. :(
  • Dhinakar
    Dhinakar over 11 years