简体   繁体   中英

Connecting Mysql database with VirtualBox Vagrant?

I installed Ubuntu on Virtual-box with Vagrant, and Virtual Machine is running on Windows. I'm running my application on Ubuntu through vagrant.

Now I want database for my application, and trying to connect MySQL Workbench with SSH Host. But workbench is continuously giving error on Authentication.

When i logged in through virtual-box the login credentials i given worked absolutely fine.

在此处输入图片说明

And on same credential workbench is giving error.

在此处输入图片说明

Now What i did is changed my SSH Hostname : 127.0.0.1:2222 as identified in Bash :

在此处输入图片说明

在此处输入图片说明

Now i'm getting this error.

I'm doing blunders in making connection, but couldn't locate from where i went wrong. Please help me setting up database for my application.

Can someone help me? Thanks

When you do vagrant up notice a line like this:

default: 22 (guest) => 2222 (host) (adapter 1)

This means port 22 (SSH port) of guest is mapped to port 2222 on host. So when accessing with normal SSH command you need to access port 2222 on host.

ssh vagrant@127.0.0.1 -p 2222

Change the port to 2222 in SSH hostname and you should be fine.

SSH hostname: 127.0.0.1:2222

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM