I am installing mtop on ubuntu 8.04 Mysql is running.
During the installation process there is a message:
Access denied for user 'root'@'localhost' (using password: NO)
(see below)
I suspect I have to allow access from unix user root to mysql account root somehow?
What are the correct steps?
$ sudo aptitude install mtop
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
The following NEW packages will be automatically installed:
libcurses-perl
The following packages have been kept back:
linux-image-server linux-server pm-utils
The following NEW packages will be installed:
libcurses-perl mtop
0 packages upgraded, 2 newly installed, 0 to remove and 3 not upgraded.
Need to get 0B/168kB of archives. After unpacking 664kB will be used.
Do you want to continue? [Y/n/?] y
Writing extended state information... Done
Preconfiguring packages ...
Selecting previously deselected package libcurses-perl.
(Reading database ... 36744 files and directories currently installed.)
Unpacking libcurses-perl (from .../libcurses-perl_1.13-1_i386.deb) ...
Selecting previously deselected package mtop.
Unpacking mtop (from .../mtop_0.6.6-1.2_all.deb) ...
Setting up libcurses-perl (1.13-1) ...
Setting up mtop (0.6.6-1.2) ...
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
dpkg: error processing mtop (--configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
mtop
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up mtop (0.6.6-1.2) ...
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
dpkg: error processing mtop (--configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
mtop
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done
Building tag database... Done
Edit: After reading the bugreport on launchpad I decided to go with the similar tool mytop
in the old ubuntu editions.
This bug describes some workarounds and even alternative (PPA) packages:
https://bugs.launchpad.net/ubuntu/+source/mtop/+bug/77980
One hacky, horrible way to fix this is to remove the MySQL root password first for localhost, then add it back it again.
mysql -u root -pwhatever
UPDATE user SET Password=PASSWORD('') WHERE User='root' AND Host='%';
Install your program
UPDATE user SET Password=PASSWORD('whatever') WHERE User='root' AND Host='%';
Once it has installed there should be a configuration file somewhere with the login details.
First open start a mysql client using your root account:
Than remove the root password only for localhost and flush the privileges:
Now install mtop, for example:
After the installation set the password back to your oldpassword:
@JamesLawrie: I strongly suggest not supplying your password directly to the command, using only -p will prompt for your password, which prevents it from being logged to your shell history, see 5.3.2.2. End-User Guidelines for Password Security
@JamesLawrie: Specifying only access to the localhost improves the security aspect. In your example you use '%' which will enable remote root access without a password!
Although in the end, fixing this bug would probably be the best approach: https://bugs.launchpad.net/ubuntu/+source/mtop/+bug/77980