0

I have virtual server hosted and this is my configuration of VPS..

ubuntu 14.04 with tomcat 8 and java 8 and i installed mysql 5.5.40

I created a new user in it with

CREATE USER 'ram'@'localhost' IDENTIFIED BY '*****';

GRANT ALL PRIVILEGES ON * . * TO 'ram'@'localhost';

FLUSH PRIVILEGES;

upto this all okay and executed perfectly..

I want to connect to this database from mylocal machine using mysql Workbench

I give ip and username it says

unknown mysql server host 'ip' (2)

I know this question is already asked so many times and i tried all of that answers,but none worked for me,so only i raised this question again here..

Already i asked in stackoverflow and came here

5
  • 'ip' must be 'localhost' not some remote IP
    – heavyd
    Dec 26, 2014 at 5:25
  • i give locahost only in server..
    – Sathaya
    Dec 26, 2014 at 5:29
  • Try by giving the grant all privileges to your local machine ip and access the MySQL from your local machine.
    – BDRSuite
    Dec 26, 2014 at 5:30
  • I tried that also ,it's not working..
    – Sathaya
    Dec 26, 2014 at 5:38
  • i can connect to my other servers from my mysql workbench,but not this server alone
    – Sathaya
    Dec 26, 2014 at 5:39

1 Answer 1

0

There can be multiple reasons. Some are listed below.

USER IS NOT CREATED TO CONNECT FROM ANY HOST

You need to create user with command listed as below

CREATE USER 'ram'@'%' IDENTIFIED BY '*****';
GRANT ALL PRIVILEGES ON * . * TO 'ram'@'%';
FLUSH PRIVILEGES;

Basically it will allow ram user to connect from any host, as you are trying to connect to VPS MySQL from your local machine. If you create the ram user with localhost, you will able to connect from VPS itself.

PORT IS NOT OPEN

Also you need to check that, the port is open on which you want to connect. That is default 3306.

You can use TELNET utility to check that whether your VPS is listening on port 3306 from your local machine or not.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .