Unable to connect to MySQL VM from host


oshirowanen

I have a Ubuntu 18.04 Desktop 64 bithost.

On this host, I created one using VirtualBox Ubuntu 18.04 Server 64 bit VM, installed MySQL on it, and created a MySQL user, a database, and a table.

I have set the network adapter in this virtual machine to Bridged Adaptor.

On the host, if you enter:

telnet <VM IP Address> <MySQL port number>

I get the following error message:

telnet: Unable to connect to remote host: Connection refused

What am I missing in the configuration?

ssnobody

The MySQL server inside the VM is only bound to localhost( 127.0.0.1).

To connect from your desktop, you need it to listen on the bridged network interface, although the easiest way is to have it listen on all interfaces .

Modify yours /etc/mysql/my.cnf(or anywhere you can find my.cnf) to uncomment or add the following line:

bind-address = 0.0.0.0

in that [mysqld]section, so it looks like this:

...
[mysqld]
bind-address     = 0.0.0.0
...

If my.cnf is not found, the locations MySQL searches in Unix and Unix-like systems are:

File Name                Purpose
/etc/my.cnf              Global options
/etc/mysql/my.cnf        Global options
SYSCONFDIR/my.cnf        Global options
$MYSQL_HOME/my.cnf       Server-specific options (server only)
defaults-extra-file      The file specified with --defaults-extra-file, if any
~/.my.cnf                User-specific options
~/.mylogin.cnf           User-specific login path options (clients only)
DATADIR/mysqld-auto.cnf  System variables persisted with SET PERSIST or SE PERSIST_ONLY (server only)

Note that some distributions also assign their own location (eg /etc/mysql/mysql.conf.d/mysqld.cnf)

See https://dev.mysql.com/doc/refman/8.0/en/option-files.html for more information .

Related


Unable to connect to VirtualBox VM from Kubuntu host using NAT

Gilberts I am using Kubuntu 13 as host and Xubuntu 12 as guest. In the VM network options, I selected NAT, and like 127.0.0.1:23 => 10.0.2.15:22. I can access the internet from the guest, but when I try to SSH to the guest, I get connection refused. Recently I

Unable to connect to mysql database from VM using Java

Florina On my host I have Wamp installed and I can connect using PHP or a browser. My client is a virtual machine using Linux and I'm trying to connect to a database on the host to add some entries to it. Here is my code: Connection conn = null; try { Stri

Unable to connect to mysql database from VM using Java

Florina On my host I have Wamp installed and I can connect using PHP or a browser. My client is a virtual machine using Linux and I'm trying to connect to a database on the host to add some entries to it. Here is my code: Connection conn = null; try { Stri

Unable to connect to mysql database from VM using Java

Florina On my host I have Wamp installed and I can connect using PHP or a browser. My client is a virtual machine using Linux and I'm trying to connect to a database on the host to add some entries to it. Here is my code: Connection conn = null; try { Stri

Unable to connect to the specified MySQL host

Shivangi Yadav: I have an application that requires my users to connect to an online MySQL database via "remote access" from any IP address (IP address from their own internet network) in order to verify that they are in the database. I am trying to run a comm

Unable to connect to the specified MySQL host

Shivangi Yadav: I have an application that requires my users to connect to an online MySQL database via "remote access" from any IP address (IP address from their own internet network) in order to verify that they are in the database. I am trying to run a comm

Unable to connect to the specified MySQL host

Shivangi Yadav: I have an application that requires my users to connect to an online MySQL database via "remote access" from any IP address (IP address from their own internet network) in order to verify that they are in the database. I am trying to run a comm

Unable to connect MemoryStore from VM

Dekuji I have created VM instance and MemoryStore instance in the same project but can't connect from VM. # telnet 192.168.1.4 6379 Trying 192.168.1.4... telnet: connect to address 192.168.1.4: Connection timed out The VPC that the VM belongs to is designated

Unable to connect MemoryStore from VM

Dekuji I have created VM instance and MemoryStore instance in the same project but can't connect from VM. # telnet 192.168.1.4 6379 Trying 192.168.1.4... telnet: connect to address 192.168.1.4: Connection timed out The VPC that the VM belongs to is designated

mysql connection from VM to host

clever host: Ubuntu 14.04 192.168.1.4 mysql database with: GRANT ALL PRIVILEGES ON . TO grails@'192.168.122.%' is identified by 'grails'; virtual machine Centos 6.6 192.168.122.111 Problem: The application (grails) does not see the mysql database located on th

mysql connection from VM to host

clever host: Ubuntu 14.04 192.168.1.4 mysql database with: GRANT ALL PRIVILEGES ON . TO grails@'192.168.122.%' is identified by 'grails'; virtual machine Centos 6.6 192.168.122.111 Problem: The application (grails) does not see the mysql database located on th

mysql connection from VM to host

clever host: Ubuntu 14.04 192.168.1.4 mysql database with: GRANT ALL PRIVILEGES ON . TO grails@'192.168.122.%' is identified by 'grails'; virtual machine Centos 6.6 192.168.122.111 Problem: The application (grails) does not see the mysql database located on th

How to connect to guest VM from host system?

oshirowanen I have a VM web server setup and have Apache installed and started. The VM has a bridged network interface and can be pinged from the host using 192.168.0.2. However, if I type the same IP address into the browser on the host, I expect to see the d

Connect to the Ubuntu VM from a terminal on the host

Leptin I'm running an instance of Ubuntu Server 14.04 in VirtualBox, and for a number of reasons I prefer to handle it with a terminal emulator on the host system (OS X 10.0) rather than the default 800x600 terminal in the VM's VGA output. Currently, I have th

How to connect to guest VM from host system?

oshirowanen I have a VM web server setup and have Apache installed and started. The VM has a bridged network interface and can be pinged from the host using 192.168.0.2. However, if I type the same IP address into the browser on the host, I expect to see the d

Connect to the Ubuntu VM from a terminal on the host

Leptin I'm running an instance of Ubuntu Server 14.04 in VirtualBox, and for a number of reasons I prefer to handle it with a terminal emulator on the host system (OS X 10.0) rather than the default 800x600 terminal in the VM's VGA output. Currently, I have th

Unable to route from one VM on LAN to host

free software server I'm frustrated/frustrated because I can't get postfix to work on one of the VMs. This is a "template" VM with which I have setup other VMs. The only difference I can really think of is what this VM is for, the ZoneMinder security software.

connect to docker mysql from host

Bogdan Dubic I have docker-compose (only showing MySQL part): site_mysql: image: site/mysql:latest build: ./images/mysql environment: MYSQL_ROOT_PASSWORD: secret volumes: - site_mysqldata:/var/lib/mysql networks: - sit

connect to docker mysql from host

Bogdan Dubic I have docker-compose (only showing MySQL part): site_mysql: image: site/mysql:latest build: ./images/mysql environment: MYSQL_ROOT_PASSWORD: secret volumes: - site_mysqldata:/var/lib/mysql networks: - sit

connect to docker mysql from host

Bogdan Dubic I have docker-compose (only showing MySQL part): site_mysql: image: site/mysql:latest build: ./images/mysql environment: MYSQL_ROOT_PASSWORD: secret volumes: - site_mysqldata:/var/lib/mysql networks: - sit

connect to docker mysql from host

Bogdan Dubic I have docker-compose (only showing MySQL part): site_mysql: image: site/mysql:latest build: ./images/mysql environment: MYSQL_ROOT_PASSWORD: secret volumes: - site_mysqldata:/var/lib/mysql networks: - sit

connect to docker mysql from host

Bogdan Dubic I have docker-compose (only showing MySQL part): site_mysql: image: site/mysql:latest build: ./images/mysql environment: MYSQL_ROOT_PASSWORD: secret volumes: - site_mysqldata:/var/lib/mysql networks: - sit

Connect to Homestead MySQL from the host

Peter Invincible I'm trying to connect to a MySQL server on a Homestead (useless) installer. I don't have any issues within SSH and can use its command line mysql without issue. Note that I want to connect to it from the host using MySQL Workbench on Ubuntu 14