Support Questions

Find answers, ask questions, and share your expertise

Hue - unable to access - MYSQL cannot connect error

avatar
New Contributor

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 http://192.168.99.100:80 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/__init__.py", 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/connections.py", 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 ? 

1 REPLY 1

avatar
Explorer

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!