I am running mysql in ubuntu server 18.04 in virtual box on my mac OS, assuming i have allowed remote access, and have it attached to a bridged adapter, how do i access the db from the mac terminal?
Answer was simple, ssh and type username and ip address of your server
ssh username#ipaddress
Related
I'm using xaamp for MySQL DB and I run my server on both cmd and ubuntu subsystem but my ubuntu says
django.db.utils.OperationalError: (2003, 'Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused")')
The reason is SubSystem Ubuntu is in another network layer. So those cannot connect.
Connecting to Windows network applications/servers from Ubuntu in WSL2
WSL2 is actually running on a separate, virtualized, NAT'd network from your Windows host. As such, you need to determine the proper IP address to use for the Windows host in order to connect to it from the WSL2 network.
Assuming a default WSL/Ubuntu installation on a supported Windows release, mDNS is usually the best option.
The mDNS name of your Windows host that you can use from within Ubuntu will look like:
MyComputerName.local
As long as you haven't changed the DNS resolver from the WSL default, that will be the same as what you see when you run hostname in Ubuntu.
You can determine this programmatically by:
Obtaining the hostname in your programming language / environment
Appending .local
For instance, in Bash, to connect to a Windows MySQL server:
Install the MySQL client in Ubuntu:
sudo apt install mysql-client
Connect to Windows MySQL server via "$(hostname).local":
mysql --hostname=$(hostname).local --user=me -p mydb
Reference: https://askubuntu.com/questions/1411512/how-to-connect-local-windows-applications-like-conda-and-mysql-from-ubuntu-on-ws
I've set up Vagrant VM, it's working well for me.
Local MySQL is working good too when connection via localhost.
But I can't find a way how to connect via vagrant to macbook local MySQL.
The only visible IP to my vagrant is my local IP address of macbook: 10.0.0.4
It pings it, but this IP is not answering any requests to port 3306, though my.cnf config is set to:
bind-address = 0.0.0.0:3306
and Mac firewall switched off for a test.
I'm not sure what info to provide, let me know in comments and I will expand my question.
Thanks a lot
In terms of being able to access the instance of mysql running on your VM's host machine, you can use the ip that vagrant uses for its natted interface.
mysql -uroot -h 10.0.2.2
If you've configured a bridged interface for your vagrant machine then you can use the ip that your host has on the interface that you have bridged to with vagrant.
I've tested this with the brew installed version of mysql and it works when the mysql server on the host is bound on 0.0.0.0 or 127.0.0.1, i.e. mysql.server start --bind-address=127.0.0.1
You can connect from your vagrant box to local mysql using
mysql --host=10.0.2.2 -uroot -p
I wanted to test my eJava application in CentOS, so I installed CentOS 6.5 in Oracle Virtual box locally in my laptop (Windows 8.1). I configured the network in the virtual machine and it is able to ping google.com as well as the host windows machine. I then installed MySQL in the CentOS VM and modified the my.cnf to edit the bind-address. Also updatd the iptables to allow input and output connections. I tried connecting to the databse from the windows host using the command
mysql -u supplychain -h 10.0.2.15 -P 3306 -p
where 10.0.2.15 is the ip address of the centos VM. I am getting the error
ERROR 2003 (HY000): Can't connect to MySQL server on '10.0.2.15' (10060)
If I run the same command in the centos host it logs into the MySQL. Any idea how this can be fixed? I already confirmed that skip-networking is removed from the my.cnf.
I have installed mysql server and workbench on a machine that is running on Ubuntu Linux platform.I also have installed mysql server and workbench on my machine that is running with Windows 7 OS.Both the machine are connected to network.I want connect to the mysql server from my machine.i tried changing the bind address of mysql server according to the machine's ip, and gave that ip as host name while connecting through mysql workbench from my machine.But i am not able to connect successfully.Please Help
Well, IMHO, the only problems that could be are ither:
Username does not have enough priveleges
Server does not accept connections
Firewall Blocking port
You should investigate each of these cases
I have a MYSQL in windows that needs to connect with MYSQL in Linux server.but I want to know is there any way to connect MYSQL in Linux server without having MYSQL in windows.
Follow the following instructions:
1. Open Terminal and type in : sudo apt-get install putty
2. Click Y on subsequent messages that appear and let the installation complete.
To use Putty, go to Menu > Internet > Putty SSH client
To connect to a remote server that supports ssh login , enter the host name or the IP address of the remote host, in case you need to frequently need to login to this server , save the session by naming it something nice.
If the connection is initiated for the first time or if the server hardware configuration has changed, you may see the message. This is to ensure that you are logging in only to the trusted server that you know and not something else.Accept that.
Finally, enter user name and password to login to the server remotely, if all goes well you will see the terminal on the remote end.
connect to mysql :
type mysql -u username -p password
You can use putty software. Here is the link to download.
You can use putty for connecting mysql.
Connection string will like this
mysql -uDBUSER -pDBPASSWORD DBNAME -hHOST-IP
Or you can also use navicat or sql yog software to connect mysql on linux system on remote.