New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Upgrade: Failed to access MySQL with default root login

Got problems with your B2 or B3? Share and get helped!
Bram
Posts: 4
Joined: 22 Jan 2011, 08:51

Upgrade: Failed to access MySQL with default root login

Post by Bram »

I tried to update my system
and it stated that it could not login as root to MySQL without using a password

Fine i remove the passwords for the root user in mysql and now it states:
Failed to access MySQL with default root login, unable to continue with upgrade

I assumed that this was perhaps the password of the admin user i enter to get to the update service but that isnt it.
can some one help me out please?
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: Upgrade: Failed to access MySQL with default root login

Post by Ubi »

did you verify that you can access mysql as root without password?
Gordon
Posts: 1464
Joined: 10 Aug 2011, 03:18

Re: Upgrade: Failed to access MySQL with default root login

Post by Gordon »

I think that for MySQL there is a difference between having an empty password or no password at all. The latter would give instant access while the first would require you to enter on the password request. The problem is that once you assigned a password to root, you cannot tell MySQL to unset it but only change it to an empty password. The only way I know is to loose the system database and reinstall. And yes that means you have to redefine everything.
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: Upgrade: Failed to access MySQL with default root login

Post by Ubi »

Or you can add another superuser, log into that user, remove and recreate the root user. Unlike posix, root is not a restricted name for mysql
Bram
Posts: 4
Joined: 22 Jan 2011, 08:51

Re: Upgrade: Failed to access MySQL with default root login

Post by Bram »

Ubi wrote:did you verify that you can access mysql as root without password?
Yes I tried that als well as using the same password as my admin account of the 3B webconsole back and forth

also the error the Software update gave me "Upgrade: Failed to access MySQL with default root login" suggest me that the Software update has a password storred. So i also tested my old root password also no sucess

@Gordon.
does the web upgrade fixes all the missing datatables and settings?
Gordon
Posts: 1464
Joined: 10 Aug 2011, 03:18

Re: Upgrade: Failed to access MySQL with default root login

Post by Gordon »

Hi Bram,

No the web upgrade will not do that. The system database "mysql" is required for mysql to operate, so once removed reinstalling mysql will create this database for you. But the way that Ubi commented should work as well I guess.
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: Upgrade: Failed to access MySQL with default root login

Post by Ubi »

i still think

Code: Select all

UPDATE user SET Password=password('') WHERE User = "Root"
should just work.
Some other suggestions here:
http://stackoverflow.com/questions/3032 ... t-password
elsbernd
Posts: 32
Joined: 18 Jul 2012, 17:40

Re: Upgrade: Failed to access MySQL with default root login

Post by elsbernd »

I've got the above problem and tried both solutions:
-

Code: Select all

update user SET Password=password('') WHERE User = "Root"
- remove all root accounts (root@localhost, root@127.0.0.1 and root@b3) from the users table and recreated them with

Code: Select all

create user 'root@'127.0.0.1';
and

Code: Select all

grant all privileges on *.* to 'root'@'127.0.0.1' with grant option;
to no avail.
Both times the software update results in

Code: Select all

Failed to access MySQL with default root login, unable to continue with upgrade
and now?

Is it possible to start the softwareupdate by command line and enter a valid password. Or store it elsewhere in the update script?
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: Upgrade: Failed to access MySQL with default root login

Post by Ubi »

I did not see a line in which you tried to login to MySQL yourself without a password. You must have done that test right?
Gordon
Posts: 1464
Joined: 10 Aug 2011, 03:18

Re: Upgrade: Failed to access MySQL with default root login

Post by Gordon »

Since bubba-backend (where this error originates) does not specify exactly what error is causing the issue, can you try the following?

Put this content in a file on your B3:

Code: Select all

import MySQLdb
try:
  MySQLdb.connect(
    host='localhost',
    user='root'
  )
except MySQLdb.OperationalError, e:
  raise MySQLdb.OperationalError("MySQL Error: %d: %s" % (e.args[0], e.args[1]))
Next execute this code by calling

Code: Select all

python <yourfile>
What return do you get from this?
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: Upgrade: Failed to access MySQL with default root login

Post by Ubi »

do you not get that exact same result by typing

Code: Select all

mysql -u root mysql
on the console?
Gordon
Posts: 1464
Joined: 10 Aug 2011, 03:18

Re: Upgrade: Failed to access MySQL with default root login

Post by Gordon »

Ubi wrote:do you not get that exact same result by typing

Code: Select all

mysql -u root mysql
on the console?
Maybe. Maybe not. That's the question. :wink:
elsbernd
Posts: 32
Joined: 18 Jul 2012, 17:40

Re: Upgrade: Failed to access MySQL with default root login

Post by elsbernd »

Ubi wrote:I did not see a line in which you tried to login to MySQL yourself without a password. You must have done that test right?
Well, I know my MySQL password, because I changed it in the past :-)
So I logged in and reset it with the first solution. Surely I had to login and get admin access, so I could remove the accounts.
Gordon wrote:Next execute this code by calling

Code: Select all

 python <yourfile>
What return do you get from this?
Nothing. Neither from within root, nor from my user account.
Ubi wrote:do you not get that exact same result by typing "mysql -u root mysql"

Code: Select all

~$ mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5542
Server version: 5.1.49-3-log (Debian)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
So, no errors at all.
I ddin't expect ones, because the hints on removing the password and re-creating the accounts have been clear.
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: Upgrade: Failed to access MySQL with default root login

Post by Ubi »

The point with debugging is that you do not assume anything, but test. 90% of the problems on this forum is because people wrongly assumed something worked in a certain way and thus saw no need to verify that it really did. Also, people that are trying to help do not want to waste time because you made an incorrect assumption, so we ask to see the result.
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: Upgrade: Failed to access MySQL with default root login

Post by Ubi »

So it assumes that the root passwd is really gone, but the installer complains about it nonetheless. My personal next step would be to temporary turn on query_logging (http://dev.mysql.com/doc/refman/5.1/en/query-log.html) and see whats going on during the update.
Post Reply