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!
Gordon
Posts: 1461
Joined: 10 Aug 2011, 03:18

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

Post by Gordon »

elsbernd wrote:
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.
Okay. That's definitely weird then, because this procedure is the exact same procedure as the one producing the message from the subject (except for the message itself of course).

I wonder if there could be some cached results involved here... Can you try restarting the bubba-apt service and then reattempt the update?
elsbernd
Posts: 32
Joined: 18 Jul 2012, 17:40

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

Post by elsbernd »

I started with the command line

Code: Select all

root@b3:~# mysql -u root 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5628
Server version: 5.1.49-3-log (Debian)
...
mysql> set global general_log = 'ON';
Query OK, 0 rows affected (0.00 sec)

mysql> show tables
    -> ;
ERROR 1046 (3D000): No database selected
mysql> Bye
Output in the mysql.log file during the system update:

Code: Select all

130611 17:27:30  5628 Query     set global general_log = 'ON'
130611 17:27:51  5628 Query     show tables
130611 17:27:54  5628 Quit      
130611 17:29:03  5629 Connect   root@localhost on 
                 5629 Query     set autocommit=0
                 5629 Quit      
130611 17:29:56  5630 Connect   root@localhost on 
                 5630 Refresh   
/usr/sbin/mysqld, Version: 5.1.49-3-log ((Debian)). started with:
Tcp port: 3306  Unix socket: /var/run/mysqld/mysqld.sock
well, I set the global_log variable to ON, as can be seen from the output of mysql.log in /var/log/mysql/)
"show tables", "quit" are my command sequence from within the mysql command (including the error of omitting the ';').

During system update, the query "set autocommit=0", followed by "quit" have been added to the output.
That's all.
It seems, that nothing has been queried by the system update.
The command "set autocommit=0" will be executed without errors, if typing it in manually.
Gordon
Posts: 1461
Joined: 10 Aug 2011, 03:18

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

Post by Gordon »

I have to say that browsing the code I can't figure out why it wants access to MySQL. It just appears to be something of a preflight check. And actually maybe that's all it is: just a check to verify that a package that actually may want to make changes to a MySQL database will install correctly.

So according to the log you provided the routine does a successful login. Does that mean that the upgrade did run correctly now?
endived
Posts: 8
Joined: 18 May 2012, 10:13

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

Post by endived »

Ubi wrote:did you verify that you can access mysql as root without password?
Is there a way to run the update without MySQL needing a blank root password?
Can't believe I'm even considering this.
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

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

Post by Ubi »

well, the update is just an elaborate perl script that wraps around the actual apt upgrade software. I fully agree that the software SHOULD be able to handle a MySQL password (or even require one!), but afaik changing this behaviour requires changing the code in the script.

Maybe (and I really ahev not tested this) you can game the system by making a /root/.my.cnf file that contains the username and password, and hope that the environment of the perl script reads and uses this file.
Post Reply