Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 31

Thread: MythTV could not connect to database

  1. #21
    Join Date
    Jun 2008
    Beans
    45
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: MythTV could not connect to database

    Quote Originally Posted by klc5555 View Post
    There are many potential ways to address these issues.

    1) Reserve the appropriate DHCP address in the router for your backend, but set up static IP for _that very same address_ on your backend machine anyway. No IP conflict, because the address is reserved for you, but you don't have to wait for your gimpy DHCP server in the router to dish out the address.
    Appreciated - this solution was useful, as was this thread in general.

  2. #22
    Join Date
    Jul 2008
    Beans
    222

    Re: MythTV could not connect to database

    Quote Originally Posted by klc5555 View Post
    Is the mysqld service on the master backend still set to accept remote connections after the upgrade?

    Have you run "mythfrontend" from a terminal on one of the remote frontends to see what the output is on the screen when mythfrontend fails to connect? Have you taken a look at what the mythbackend log and the mythfrontend log indicate after one of the failed connect attempts? May give you a bit more data to debug your issue with.
    My Backend is on a static IP, time zone is ok & NTP is Ok.
    I started Mythfrontend from the remote, and this is the error I get:

    QMYSQL: Unable to connect
    Database error was:
    Access denied for user 'mythtv'@'ttbunt.local' (using password: YES)

    mythtv is the right user I always used and all PWD are correct. Pin is 0000 and tested OK. ttbunt is the remote machine I'm using.

    Any ideas?

  3. #23
    Join Date
    Mar 2008
    Beans
    1,086

    Re: MythTV could not connect to database

    Quote Originally Posted by dibuntux View Post
    My Backend is on a static IP, time zone is ok & NTP is Ok.
    I started Mythfrontend from the remote, and this is the error I get:

    QMYSQL: Unable to connect
    Database error was:
    Access denied for user 'mythtv'@'ttbunt.local' (using password: YES)

    mythtv is the right user I always used and all PWD are correct. Pin is 0000 and tested OK. ttbunt is the remote machine I'm using.

    Any ideas?

    Is the mysqld service on the master backend still set to accept remote connections after the upgrade? Check in its MCC.

    If the above is not the issue, then is the password that your mythfrontend is using after the upgrade really the current correct one? Can you use it to log into mysql directly from a prompt on the backend machine? i.e.:
    Code:
    mysql -u mythtv -p
    If you can log into mysql using the mysql password, and have exited, check whether the config.xml file in the /.mythtv directory under /home/mythtv (and the one under /home/[your main user]) on the remote frontend machine is set up with the correct dbhost address, username, and mysql password.

    On the backend, check whether the my.cnf file (usually under /etc/mysql/ ) has the line "skip-networking" remarked out ("#"), and that there is a line
    Code:
    bind-address =
    that has your master backend's IP address. Also the init or upstart script under /etc/init.d used to start the mysql daemon can be checked for a line similar to:
    Code:
    SKIP=" --skip-networking"
    which, if it exists in the file, will need to be remarked out (#) . Either of these "skip" lines being active would render your backend mysqld local-host only. If a change is introduced in either of these files, mysqld will need to be restarted for it to take effect.

    These are some of the things that can be checked.

  4. #24
    Join Date
    Jul 2008
    Beans
    222

    Re: MythTV could not connect to database

    OK the pwd is incorrect: mysql -u mythtv -p
    I can enter with the pwd which is displayed on the backend in Setup/General, which is a new one.

    On the remote, if I try to input this pwd in place of the old one I had previous the upgrade, the procedure come back at same mask, with displayed the old pwd: I cannot change the pwd!

    So now what?

  5. #25
    Join Date
    Mar 2007
    Location
    Christchurch, NZ
    Beans
    3,239

    Re: MythTV could not connect to database

    Change the password in the see file. mysql.txt and/or config.xml

  6. #26
    Join Date
    Mar 2008
    Beans
    1,086

    Re: MythTV could not connect to database

    Note also that on your remote frontend you'll have at least 2 of these config.xml files, and possibly as many as four or more (under /home/mythtv/.mythtv ; /home/[your user]/.mythtv ; /root/.mythtv ; maybe under /user/share/mythtv/somewhere-or-other ; also possibly under /etc/mythtv ; and finally under /home/any-other-users-on-the-machine/.mythtv ) These will all need to be found, checked and (where necessary) corrected. There may be multiple mysql.txt's with roughly the same distribution as above, or none (the file is now deprecated). But, wherever it may exist, it will need to be checked for correctness.

  7. #27
    Join Date
    Jan 2007
    Beans
    95
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: MythTV could not connect to database

    This happens even though you check the box or answer the question about "Are you going to access the backend from a remote frontend?" during installation.

    What actually happens is remote FEs cannot connect and you get the cannot connect to database message.

    It is a MythBuntu install bug that has been around for years.

    In addition to the bind 127.0.0.1 problem in my.cnf, the installer sets the backend to use 127.0.0.1 in error as well. What happens is that if you have a just installed a FE/BE, the FE only works on that system, but not on any remote system.

    The installer should use the current IP# as was assigned during install because you already said you are going to use remote FEs. The other problem is that IP# is a DHCP and you really want a static, manual IP#. Also the installer should fix my.cnf to allow remote FEs.

    For now:
    1. # the bind line in my.cnf, restart mysql
    2. set up a static IP on BE
    3. put the IP into the BE
    4. put the IP and password in remote FEs

    That is what I do. I am sure I have something wrong, so feel free to correct.

    HTH;
    John

  8. #28
    Join Date
    Apr 2010
    Beans
    4

    Re: MythTV could not connect to database

    I've just upgraded from 0.25 to 0.26 and had the same problem. i.e. not being able to get the frontend to connected to the backend, mythweb was working fine all the passwords, IP addresses etc etc etc all good just couldn't connect to the backend.

    The solution was ridiculously simple:

    1. On the backend machine, open the system menu and open "Mythbuntu Control Centre"
    2. Click the MySQL tab and at the top of the page change the "Master Backend Role" from "Disable" to "Enable" then hit Apply.


  9. #29
    Join Date
    Jul 2008
    Beans
    222

    Smile Re: MythTV could not connect to database

    Quote Originally Posted by klc5555 View Post
    Note also that on your remote frontend you'll have at least 2 of these config.xml files, and possibly as many as four or more (under /home/mythtv/.mythtv ; /home/[your user]/.mythtv ; /root/.mythtv ; maybe under /user/share/mythtv/somewhere-or-other ; also possibly under /etc/mythtv ; and finally under /home/any-other-users-on-the-machine/.mythtv ) These will all need to be found, checked and (where necessary) corrected. There may be multiple mysql.txt's with roughly the same distribution as above, or none (the file is now deprecated). But, wherever it may exist, it will need to be checked for correctness.
    To re-check backend net capabilities I downloaded MythTv Android Frontend on my Zopo mobile: it worked ok, so no problem on the backend.

    So I checked files is /home/[your user]/.mythtv :
    config.xml had user permission and in there the new pwd was set
    mysql.txt had root permission and pwd was the OLD one! Changed the pwd to the new one (as root) and it now works as before.

    Not exactly user friendly... even for a long time myth user...

    Thank you for helping me, and hopefully many others, in solving this!

    Merry Xmas to all!

  10. #30
    Join Date
    Jan 2007
    Beans
    95
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: MythTV could not connect to database

    There should be only one!

    Code:
     locate mysql.txt
    /etc/mythtv/mysql.txt
    /home/gelmjw/.mythtv/mysql.txt
    /home/mythtv/.mythtv/mysql.txt
    /usr/share/mythtv/mysql.txt.dist
    root@pvr:/home/gelmjw# ls -lha /home/gelmjw/.mythtv/mysql.txt
    lrwxrwxrwx 1 gelmjw gelmjw 21 Dec  7 14:28 /home/gelmjw/.mythtv/mysql.txt -> /etc/mythtv/mysql.txt
    root@pvr:/home/gelmjw# ls -lha /home/mythtv/.mythtv/mysql.txt
    lrwxrwxrwx 1 root root 21 Dec  7 14:20 /home/mythtv/.mythtv/mysql.txt -> /etc/mythtv/mysql.txt
    root@pvr:/home/gelmjw#
    Links to the one.

    HTH;
    John

Page 3 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •