Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hey,

ich versuche mit einer .jar auf eine externe DB zu gehen. In der DB ist als Host % angelegt.

als Meldung bekomme ich:

java.sql.SQLException: Server connection failure during transaction. Due to underlying exception: 'java.sql.SQLException: Invalid authorization specification message from server: "Access denied for user 'USER'@'IP/HOST' (using password: YES)"'.


** BEGIN NESTED EXCEPTION ** 


java.sql.SQLException

MESSAGE: Invalid authorization specification message from server: "Access denied for user 'USER'@'IP/HOST' (using password: YES)"


STACKTRACE:


java.sql.SQLException: Invalid authorization specification message from server: "Access denied for user 'USER'@'IP/HOST' (using password: YES)"

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2001)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1907)

    at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:2524)

    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:818)

    at com.mysql.jdbc.Connection.createNewIO(Connection.java:1926)

    at com.mysql.jdbc.Connection.<init>(Connection.java:452)

    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411)

    at java.sql.DriverManager.getConnection(Unknown Source)

    at java.sql.DriverManager.getConnection(Unknown Source)

    at General.Db_Connection.getConnection(Unknown Source)

    at General.Db_Connection.<init>(Unknown Source)

    at General.Index.openDBConnection(Unknown Source)

    at General.Index.<init>(Unknown Source)

    at General.Index.main(Unknown Source)



** END NESTED EXCEPTION **



Attempted reconnect 3 times. Giving up.
SER & IP/HOST hab ich natürlich durch die richtigen Daten ersetzt (mit einem SQL Programm komm ich auf die DB)
public Db_Connection(Index index, String mysqlHost, int mysqlPort, String mysqlDatabase, String mysqlUser, String mysqlPassword, String db_pre) 

    {                     

        try 

        {

            loadDrivers();

            getConnection(mysqlHost, mysqlPort, mysqlDatabase, mysqlUser, mysqlPassword);


            console("Connection to Database sucess");

        }

        catch (ClassNotFoundException e) 

        {

            e.printStackTrace();

        }

        catch (SQLException e) 

        {

            console("Can't connect to Database: "+e.toString());

        }

    }


private void loadDrivers() throws ClassNotFoundException 

    {

        Class.forName("com.mysql.jdbc.Driver");

    }



private void getConnection(String mysqlHost, int mysqlPort, String mysqlDatabase,String mysqlUser, String mysqlPassword) throws SQLException 

    {

        conn = DriverManager.getConnection("jdbc:mysql://" + mysqlHost

        + ":"+mysqlPort+"/" + mysqlDatabase + "?user=" + mysqlUser

        + "&password=" + mysqlPassword + "&autoReconnect=true");        

    }

Ja hab schon alles mögliche Versucht... Aber wenn der Host auf % steht dann ist doch jeder Host erlaubt. Was könnte ich also falsch machen?

Der User wird nicht richtig sein. USER@IP/HOST bzw. PW. Ist die Usereingabe richtig bei dir?

Mal ne andere Frage: Funktioniert es, wenn du den Sourcecode in der IDE ausführst?

Bearbeitet von eifeljeti66

Due to underlying exception: 'java.sql.SQLException: Invalid authorization specification message from server: "Access denied for user 'USER'@'IP/HOST' (using password: YES)"'.

Die Fehlermeldung ist doch klar und deutlich

  • Autor
Die Fehlermeldung ist doch klar und deutlich

Wie oben in meinem ersten Tread schon erwähnt "mit einem SQL-Programm funktioniert das ganze(SER & IP/HOST hab ich natürlich durch die richtigen Daten ersetzt (mit einem SQL Programm komm ich auf die DB)

Nur die Frage ist wieso nur nicht über IDE oder direkt .jar

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.