Witam. Problem powstał gdy próbuję połączyć bazę danych. Przechwytuję błąd jak w kodzie poniżej, :
@Override
protected void doGet( HttpServletRequest req, HttpServletResponse resp )
throws java.io.IOException, ServletException {
try {
Driver sterownik = new com.mysql.jdbc.Driver();
DriverManager.registerDriver(sterownik);
Connection conn = sterownik.connect("jdbc:mysql://localhost?user=root&password=thnkgy",
null);
Statement stm = conn.createStatement();
if( stm.execute("SELECT * from Uzytkownik")) {
ResultSet zbior = stm.getResultSet();
while( zbior.next() ) {
resp.getWriter().println( zbior.getString("imie") + " "
+ zbior.getString("nazwisko") + "\n" );
}
}
conn.close();
} catch ( SQLException e ) {
resp.getWriter().println( e.getMessage() );
}
}
I gdy próbuję uruchomić apkę wywala mi komunikat ( SQLException.getMessage() ) :
"Client does not support authentication protocol requested by server; consider upgrading MySQL client"
Wydaje mi się, że coś z tym adresem :
"jdbc:mysql://localhost?user=root&password=thnkgy"
jest nie teges ale co bym nie próbował to efekt jest taki sam.
gdy skracam ten zapis do postaci:
"jdbc:mysql://localhost"
... efekt oraz wyświetlany komunikat taki sam.
Pomoże ktoś?
@Patryk27 to sb to przeczytaj z tych wyników google masz tu 1 z 513 tysiecy wyników : https://stackoverflow.com/questions/50505042/mysqlnontransientconnectionexception-client-does-not-support-authentication-pro/52024764
jdbc client does not support authentication protocol requested by server
w Google zwraca 513 tysięcy pasujących stron.