Pb resolu:
En fait sous linux (surtout pour Redhat)
on doit faire dans MySQL (dans phpmyadmin c tres bien aussi) un :
GRANT ALL PRIVILEGES ON nom_dela_base. * TO'utilisateur'IDENTIFIED BY 'mot_passe';
|
y a plus d'info
ici-------------------------------
Réponse au message :
-------------------------------
> J''utilise un code trouvé sur ce site pour me connecter à mysql :
>
>
>
> import java.sql.*; > // > public class TestMM > { > public static void main(String args[]) > { > // Chargement du driver JDBC > try > { > System.out.println("debut"); > Class.forName("org.gjt.mm.mysql.Driver").newInstance(); > System.out.println("fin"); > } > catch (Exception e) > { > System.err.println("Chargement du pilote impossible."); > System.err.println(e); > } > // > // Etablissement de la connexion > try > { > Connection connexion = DriverManager.getConnection > ("jdbc:mysql://127.0.0.1/projet_java","root",""); > System.out.println ("La connexion fonctionne parfaitement"); > connexion.close(); > } > catch(SQLException e) > { > System.err.println("***** SQLException : *****"); > while (e != null) > { > System.out.println("Message : " + e.getMessage ()); > System.out.println("Etat : " + e.getSQLState ()); > System.out.println("Code Erreur : " + e.getErrorCode () + "\n"); > e = e.getNextException(); > } > } > } > } > |
>
> apres compilation j'ai:
>
> debut > fin > ***** SQLException : ***** > Message : Server configuration denies access to data source > Etat : 08001 > Code Erreur : 0 > |
>
> Pourtant Mysql est bien lancé...
> (tout est ok avec phpmyadmin)