"10061" Error When Connecting to MySQL Hosted on Ubuntu Server VM
#1
Hey Guys -

After adding yet another Kodi system in my home, I decided it was time to set up mySQL for a shared database. I've done it successfully before in Windows, but this time wanted to run it in VM to keep it separate from the tons of other things my "server" hosts. After getting everything set up and configured, it isn't working, though.

The Issue
When I launch a fresh install of Kodi which has a custom advancedsettings.xml, it fails to connect to the mySQL server. I built the mysql server in a VirtualBox VM with Ubuntu Server 15.04 x64 installed. All installation steps I performed are below. I also installed mySQL Workbench on the server (Windows 10 - not the linux VM it hosts) and tried to connect to the DB but got the same error - 10061.

Link to the log file - kodi.log (Even though it doesn't contain much more info than what I've said above)

What I've Tried to Fix
- Verified that "bind-address" didn't exist in any .cnf file in VM
- Verified that I could at least ping VM's static IP - I could
- Tried adding "bind-address 0.0.0.0" to mysql.cnf. When restarting mysql service after change, service wouldn't start again
- Tried to connect using mySQL Workbench (installed on Windows host) - same error - 10061 nomatter if I try using root or kodi user
- Tried granting all privileges to root user via these instructions

mySQL Users Query Results
Image

Virtual Machine Configuration Steps
1. Created new VirtualBox VM and installed Ubuntu Server 15.04 x64 using OEM ISO
2. Once installed, logged into VM locally- did all the following from terminal - no GUI installed or used
3. Installed / updated headers
4. Installed Virtualbox Guest Tools - rebooted
5. Ran apt-get install mysql-server - no errors
6. Ran apt-get update / apt-get upgrade - no errors - rebooted
7. Reran step #5 to verify all was updated
8. Set a static IP and verified that it was correct after reboot (192.168.0.240)
9. Checked mysql.cnf & sql.cnf for bind-address string, but wasn't present anywhere
10. Ran commands on steps page to create kodi user and assign permissions
11. Exited mysql prompt and restarted service
12. Installed fresh installation of Kodi on the server (Win10)
13. Prior to first run, created advancedsettings.xml and literally copy/pasted code from example page

Media Server Specs
- Intel i7 3770k CPU / 16gb RAM
- 30tb drive pool for media (all located on single virtual partition)
- All Kodi systems access media via SMB shares on this system
- VirtualBox 5.0

Kodi Systems
- Living Room - Running on dedicated full computer running Windows 7 (Connected to server via 1gbps ethernet)
- Bedroom - Running on Raspberry Pi 2 (Connected via WiFi (N))
- Office - Running on iMac 27" (El Capitan) (Connected to server via 1gbps ethernet)
- Temporary - Running locally on my "server" just to set up DB as media is local - Windows 10 x64

Extra Credit / Optional Question
As mentioned, I decided to create the Kodi DB in a VM using Ubuntu server instead of just installing mySQL directly onto Windows. I use the Windows system for many various things from hosting web services to gaming. I thought that I'd use the Ubuntu Server VM as it takes minimal resources but that I've also read / heard that mySQL runs much better in Linux plus can be snapshotted - however - you also have to consider that the linux VM has minimal resources assigned compared to the Windows host. Given this situation, which of the below choices would you think be the best solution?
- DB hosted in Ubuntu Server VM on Windows host (current solution)
- DB installed directly onto Windows host and configured not to be dedicated server (resource sharing)
- DB installed on an old computer I have lying around (Probably Pentium 4 or Celeron /w 2gb RAM) If this one, which OS? Windows XP/7/8/10 Linux (Any distro) - Server of GUI?

So that's about it. I tried to provide all detail I had available. Any suggestions that you have would be appreciated!

Thanks Guys!
- BzowK -
Reply
#2
Try out some of the following:

Quote:The error (2003) Can't connect to MySQL server on 'server' (10061) indicates that the network connection has been refused. You should check that there is a MySQL server running, that it has network connections enabled, and that the network port you specified is the one configured on the server.

Start by checking whether there is a process named mysqld running on your server host. (Use ps xa | grep mysqld on Unix or the Task Manager on Windows.) If there is no such process, you should start the server. See Section 2.10.2, “Starting the Server”.

If a mysqld process is running, you can check it by trying the following commands. The port number or Unix socket file name might be different in your setup. host_ip represents the IP address of the machine where the server is running.

shell> mysqladmin version
shell> mysqladmin variables
shell> mysqladmin -h `hostname` version variables
shell> mysqladmin -h `hostname` --port=3306 version
shell> mysqladmin -h host_ip version
shell> mysqladmin --protocol=SOCKET --socket=/tmp/mysql.sock version

Regarding the use of backticks rather than forward quotation marks with the hostname command; these cause the output of hostname (that is, the current host name) to be substituted into the mysqladmin command. If you have no hostname command or are running on Windows, you can manually type the host name of your machine (without backticks) following the -h option. You can also try -h 127.0.0.1 to connect with TCP/IP to the local host.

Make sure that the server has not been configured to ignore network connections or (if you are attempting to connect remotely) that it has not been configured to listen only locally on its network interfaces. If the server was started with --skip-networking, it will not accept TCP/IP connections at all. If the server was started with --bind-address=127.0.0.1, it will listen for TCP/IP connections only locally on the loopback interface and will not accept remote connections.

Check to make sure that there is no firewall blocking access to MySQL. Your firewall may be configured on the basis of the application being executed, or the port number used by MySQL for communication (3306 by default). Under Linux or Unix, check your IP tables (or similar) configuration to ensure that the port has not been blocked. Under Windows, applications such as ZoneAlarm or the Windows XP personal firewall may need to be configured not to block the MySQL port.
Reply
#3
Also on the vm try
Code:
netstat -tanp |grep 3306
to check what interface mysql is listening on.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply

Logout Mark Read Team Forum Stats Members Help
"10061" Error When Connecting to MySQL Hosted on Ubuntu Server VM0