New Contributor
Posts: 1
Registered: ‎08-14-2017

Hue - unable to access - MYSQL cannot connect error

I have started docker based cloudera container using kitematics.It isnt starting Hue by default (all other services start ) and I restarted it. . Now it lets me access the but when I access Hue on port 8888 it gives this error after a while - 

  File "/usr/lib/hue/build/env/lib/python2.6/site-packages/MySQL_python-1.2.5-py2.6-linux-x86_64.egg/MySQLdb/", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/usr/lib/hue/build/env/lib/python2.6/site-packages/MySQL_python-1.2.5-py2.6-linux-x86_64.egg/MySQLdb/", line 193, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
OperationalError: (2003, "Can't connect to MySQL server on 'quickstart.cloudera' (110)")

I see that MYSQLD service is running though. I am not sure what is the issue . can you please help ? 

New Contributor
Posts: 4
Registered: ‎12-29-2017

Re: Hue - unable to access - MYSQL cannot connect error

I encountered the same issue running the docker-based cloudera quickstart on a AWS EC2 instance and accessing from my local computer.  The resolution was as follows:


  • Ensure that the hostname `quickstart.cloudera` resolves to the appropriate IP address.  I forced this by manually editing the `/etc/hosts` file locally (on a mac)
  • Figure out / ensure that MySQL is listening on port 3306 within the container (`netstat -lntp` within the container to check this)
  • Ensure that traffic at port 3306 on the host passes through to the container appropriately.  This amounts to adding `-p 3306:3306` to the `docker run` command


It seems that the Hue UI wants to access the MySQL database directly, which is a bit strange to me... in any case, that means that the client computer / browser needs to be able to access the MySQL database at `quickstart.cloudera:3306`.  Hope that helps, even if long after the fact!