[mythtv-users] Upgraded the Ubuntu 11.10 and not Myth can't connect to MySQL

R. G. Newbury newbury at mandamus.org
Sat Nov 5 04:12:29 UTC 2011

> Hi Geoff,
> Thanks so much for helping out. Hope we can get to the bottom of this.
> is definately my correct ip address. It can't not be as my
> router assigns the IP's, but I have also double checked this now with
> ifconfig.
> The first thing I did was change my hosts file, so this now reads:
> localhost.localdomain localhost
> # ::1 MythBox localhost6.localdomain6 localhost6
> # MythBox
> MythBox

This is good, especially if this is a backend. Make sure that the 
mysql.txt and config.xml files use the *NAME* and that all boxes have 
that line in their /etc/hosts file. Then those other boxes can find the 
mysql server.

This is stuff is completely irrelevant at present. We don't use IPv6
> # The following lines are desirable for IPv6 capable hosts
> ::1 ip6-localhost ip6-loopback
> fe00::0 ip6-localnet
> ff00::0 ip6-mcastprefix
> ff02::1 ip6-allnodes
> ff02::2 ip6-allrouters
> ff02::3 ip6-allhosts
> I then re-booted with fingers crossed in the hopes that this little
> change was the solution to all. Alas, not. Did I change it correctly?
> I then went on with your suggestion. I typed
> mysql -u mythtv -pmythtv mythconverg
> which returned:
> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
> '/var/run/mysqld/mysqld.sock' (2)
 > This is not the same as the predicted: 'login not allowed for user
> mythtv at whereever'. Does this tell you anything different?

Yes: The *usual* reason for this is that the /var/run/mysqld folder is 
NOT owned by mysql. Check this. If not so owned, go to /var/run and do: 
  chown -R mysql:mysql mysql

> I wanted to check again that mysql was actually running (since the
> re-boot), so typed:
> sudo service mysql status
> which returned:
> mysql start/post-start, process 4732
> post-start process 4733
> What on earth does that mean?

I don't see that on Fedora, but those numbers are most likely the PID 
numbers for the running processes. Check by running 'ps -ae | grep 
mysql' which should show something like:
1492 ?        00:00:00 mysqld_safe
1697 ?        00:00:12 mysqld

> I'm now on the edge of family understanding. Two weekends of watching
> X-factor over the internet rather than watching pre-recorded is enough
> for them to start thinking about a Windows based system! Help! :-)
> I'm not sure If I should cary on with your next step as the returned
> message from the last step didn't match up with what was expected. Let
> me know what to do next if you can.

It would be useless to do what I next suggested as the mysql server 
itself was not set up correctly and could not be contacted.

> I should also say that this system has always been more than a single
> FE/BE machine. I have other machines that log into MythTV as Frontends
> to the system.

Then getting mysql working is really important! There are a number of 
really good chapters on troubleshooting in the Mysql manual available 
online. The various error messages are listed and explained. That is how 
I learned about mysql setup!

Of course google works too!  Just google 'mysql error 2002' and you will 
get LOTS of links.

....find an error, read about it: free, find it again a couple of months 
later, curse yourself for *almost* being able to remember how to fix it, 
but NOT QUITE being able to do so...priceless!


More information about the mythtv-users mailing list