0
votes

I am new to MySql and trying to setup a connection. I have provided the below details: ConnectionName: RefferBuddy ConnectionMethod : Standard(TCP/IP) Hostname: 127.0.0.1 Port : 3306 username : root password: root

Now when I click on Test Connection, I get the error "Failed to connect to MySql at 127.0.0.1:3306 with user root".

Can some one help me on this.

Also, I have installed mysql workbench. Do we need to install mysql server also? Thank You.

1
try to change the 127.0.0.1 and put localhost - nacho
Yes, you need to install mysql server too. Which OS are you using? - PineapplePizza
I am using Windows7 - user6025319

1 Answers

0
votes

How was the database created?

One of the methods i use to create the database is with Docker (https://www.docker.com/).

Once you download Docker, you can create a Database with the following docker-compose.yml file:

# use version 3 of the docker compose syntax
version: '3'
services:
  db:
    # use a default image
    image: mysql:5.7

    # Port mapping 
    ports:
      - 3306:3306

    # the mysql image uses these to create database and users
    environment: 
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: Refferbuddy
      MYSQL_USER: Refferbuddy
      MYSQL_PASSWORD: root

After the file is ready, execute the following command to create the database:

docker-compose up -d

Now you can connect to it with MySQL workbech with the following connection:

ConnectionName: RefferBuddy
ConnectionMethod : Standard(TCP/IP)
Hostname: 127.0.0.1
Port : 3306
username : Refferbuddy
password: root

More information here: https://hub.docker.com/_/mysql/