facebook

Connecting to MySQL

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #252999 Reply

    rstudner
    Participant

    I have mysql 5 running as a service on my winxp box… I can go to cmd and run mysqlshow and get the tables to appear…

    I opened up myeclipse 4.1.1… went to the db explorer view..

    I configured the driver, pointed to the connector/j jar)..

    for the url.. I’ve tried leaving the template default.. reducing it to the minimum (since with no IP and no port it defaults to 127.0.0.1 and 3306 according to the docs).

    I always get ‘unable to create connection check your URL’.

    Sorry.. don’t have it in front of me to type the exact text..

    I’m curious to know if it generally is ‘really easy’ to setup, and i’m just missing it haha.

    #253000 Reply

    rstudner
    Participant

    Okay.. more details: Connector/J jar is 3.1.13

    New Driver
    Driver Tempalate MySQL Connector/J Driver
    Connection URL: jdbc:mysql://<hostname>[<:3306>]/dbname

    Okay.. so the driver is in, as above.

    now I am at New Database Connection Profile
    profile name: mysql-jdbc
    Driver: MySQL Connector/J Driver

    For URL i’ve tried leaving it as above (which shouldn’t work)
    i’ve tried jdbc:mysql:// (which then defaults to 127.0.0.1 and :3306 according to the docs).

    I have both a ‘root’ account with a password, and I even reinstalled MySQL to have the ‘anonymous account’ (thought that would help).

    I still can essentially ‘never’ get myeclipse to connect to my mysql db

    Any ideas :)?

    Thanks.
    Roger

    #253048 Reply

    Haris Peco
    Member

    Roger,

    If you got this message

    ‘unable to create connection check your URL’

    then you type wrong url or your driver is too old

    try use this url

    jdbc:mysql://127.0.0.1:3306/test

    You have to download jdbc driver from mysql (latest stable is 3.1.12) and add jar in configure driver wizard

    Best

    #253324 Reply

    Lance Drake
    Member

    Hi Roger,

    It just may be that you have yet to perform the “GRANT ALL…” permissions statement on the database to which you want to connect.

    F’rinstance – if you wish to connect as USER = roger and PASSWORD = wilco – and you’re accessing MySQL from the same machine, then you could do this <via command line>:

    1) cd to the dir that has the mysql binary in it
    2) Launch MySQL via the root user (mysql -u root -p)
    3) Enter your password (wilco)
    4) at the mysql prompt enter:

    GRANT ALL ON yourdatabase.* TO roger@localhost IDENTIFIED BY ‘wilco’;

    or… if you were on another machine…

    GRANT ALL ON yourdatabase.* TO roger@192.168.0.3 IDENTIFIED BY ‘wilco’;

    5) Exit mysql (type \q at the prompt) and give the connection another try…

    G’Luck!

    #253325 Reply

    Lance Drake
    Member

    Hi roger… enter the ROOT password when logging in – not necessarily ‘wilco’ — THE FREAKIN’ DETAILS GET ME EVERY TIME!

    #255353 Reply

    hgari
    Member

    This message has not been recovered.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Connecting to MySQL

You must be logged in to post in the forum log in