NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

yengip's avatar
yengip
Aspirant
Oct 14, 2011

phpmyadmin add-on - can't log in

Hi all,

I'm a mid-level linux beginner - not a complete newbie but certainly not a competent administrator. I have a ReadyNAS NV+ using RAIDiator 4.1.8 [1.00a043].

I've spent some hours fiddling with this and just can't get it working. I've followed the thread called "phpmyadmin add-on which username and password ?" (http://www.readynas.com/forum/viewtopic.php?f=36&t=48440) but no joy. Here's where I am:

When I first installed the add-on (PhpMyAdmin_3.4.5-rnsparc-1.2.8 along with PHP5_5.3.8-rnsparc-1.4.1 in a bundle) it wouldn't work at all and told me mysqli and mcrypt weren't installed. So I laboriously found the php configuration file at /etc/php5/apache2/php.ini and added the relevant extension lines. Now I can get the set up screen and log in screen.

I created a server using the setup screen. Here's the config file as displayed by the utility:
<?php
/*
* Generated configuration file
* Generated by: phpMyAdmin 3.4.5deb1.1 setup script
* Date: Fri, 14 Oct 2011 20:57:34 +0100
*/

/* Servers configuration */
$i = 0;

/* Server: ReadyNasNV [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = 'ReadyNasNV';
$cfg['Servers'][$i]['host'] = '192.168.2.4';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '/var/run/mysqld/mysqld.sock';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Servers'][$i]['nopassword'] = true;

/* End of servers configuration */

$cfg['blowfish_secret'] = '4e9882f99f38e7.03410021';
$cfg['DefaultLang'] = 'en';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
?>


I installed MysqlOn and checked that the service was running by starting mysql monitor at the command line in an SSH session. I don't need a login or password to start this and I can see the databases and display users from the mysql database. I even created a user with a password and granted all privileges. I can use this new user to log into the mysql monitor at the command line and select data from various tables so I know it works.

When I try and login to phpmyadmin with root and no password it tells me "Login without a password is forbidden by configuration (see AllowNoPassword)". When I try and login using the userid and password I set up using mysql it tells me "#2002 Cannot log in to the MySQL server".

The only conclusion I can draw is that the actual phpmyadmin program is using a different config file than the one that the setup program is generating. I can't actually find the config file on the READYNAS anywhere but I suppose it must be there somewhere.

If someone could point me in the right direction I'd be very grateful as I'd quite like to use the NAS as a web server.

Thanks in anticipation,

Ian

10 Replies

Replies have been turned off for this discussion
  • That is really helpful, thank you. I was missing the change from tcp to socket.

    Unfortunately, it hasn't actually remedied the situation and I still can't log in. Oddly, when I started to use the setup utility again no config files were listed and I suspect that it's not being saved, even though I am clicking the save button on the main page as well as the one on the configuration page. Can you tell me where it should be so I can see if it's actually there?

    Again, your rapid help is much appreciated.

    Ian
  • UPDATE

    With lots of help from WhoCares? the problem was resolved by reinstalling PHP and then removing and reinstalling phpmyadmin using the ReadyNas Frontview interface.

    It looks like the original installs didn't create the correct environment in the first place for some reason and the setup utility wasn't able to write to the directory where it wanted to store the config.inc.php file.

    All sorted now - Thanks a bunch for all your help Stefan

    Ian
  • I have installed the PHP, MYSQLON, PHPMYADMIN add-ons, but can't get phpmyadmin it to work.

    Before the add-on I had php5 installed by apt-get install libapache2-mod-php5, and it worked, but removed it to use the add-on and the default phpmyadmin package.
    which didn't worked and remove then both and did a apt-get --purge remove and apt-get clean.

    Installed the php add-on, that worked, but the phpmyadmin isn't working. The config file can't be written. I have created a config folder in /usr/share/phpmyadmin/ and chmod o+rw
    But I'm still getting the following error: Cannot load or save configuration

    I manually copied the config file, but I can't login. The message is "Login without a password is forbidden by configuration (see AllowNoPassword)" while I have set $cfg['Servers'][$i]['AllowNoPassword'] = true;

    Could someone give me some pointers on how to fix this? It's driving me insane
  • I'm a step closer I removed phpmyadmin and it's folders and installed it again. Now the settings for a new server can be saved,

    But I can't login: #1043 Cannot log in to the MySQL server

    I have done this:
    http://readynasxtras.com/faq

    How can you check if the mysql server is actually running?

    When I do:
    /etc/init.d/mysql restart

    It says:

    Stopping MySQL database server: mysqld failed!
    Starting MySQL database server: mysqld . . . . . . . . .
  • My guess is your attempting to connect to the MySQL server using SSL. This is NOT the same thing as using SSL for connections to phpmyadmin.

    In the configuration area, go to the overview area and look for the option: "Enable SSL for connection to MySQL server" and disable it, then try logging in again. I had this very issue, and that's how I fixed it.

    You can leave the option "Force secured connection while using phpMyAdmin" enabled, as this only deals with the connection between phpmyadmin and your web browser, not the connection between phpmyadmin and the MySQL server, as I already mentioned above.

    I must say I am slightly worried about the security issues associated with this. especially since in order to access the server from other machines on my network the "bind-address = 0.0.0.0" option has to be set in my.cnf, and therefore MySQL is listening on ALL interfaces, and could be compromised by an outside attacker (potentially).
  • gibxxi wrote:
    My guess is your attempting to connect to the MySQL server using SSL. This is NOT the same thing as using SSL for connections to phpmyadmin.

    Another reason may be that the root password was changed - just sawthis yesterday. A user had unknowingly had his root password changed byan application he had installed on the ReadyNAS.

    gibxxi wrote:
    In the configuration area, go to the overview area and look for the option: "Enable SSL for connection to MySQL server" and disable it, then try logging in again. I had this very issue, and that's how I fixed it.

    The problem with SSL connections is that the new PHP mysql client doesn't support them. This could be fixed by using the standard MySQL client weren't it for the fact that this one freezes PHP completely when being used with MySQLi connections on the ReadyNAS.

    gibxxi wrote:
    I must say I am slightly worried about the security issues associated with this. especially since in order to access the server from other machines on my network the "bind-address = 0.0.0.0" option has to be set in my.cnf, and therefore MySQL is listening on ALL interfaces, and could be compromised by an outside attacker (potentially).

    Instead of binding MySQL to 0.0.0.0 you could use the actual IP address but that wouldn't make it any more secure since this still is the public IP address of the ReadyNAS. So either you restrict the user accounts on the MySQL server to certain trusted IP addresses or, if you don't need any external access to the MySQL server, you only use the socket connection through the /var/run/mysqld/mysqld.sock socket.

    -Stefan
  • Wow it worked! The ssl trick seems to did it, the strange thing is, after saving the setup file, it's changed the ssl option automaticly to on.
    So I removed it out of the config file and the DB was working.

    Maybe you could add this to the faq on readynasextras?

    Thanks for your help gibxxi and whocares!
  • If you make any changes to the /etc/phpmyadmin/config.inc.php file (i.e: via SSH) those changes will override any changes you make via the "Configure phpmyadmin" link in frontview, because those changes are saved to another file. Specifically;

    /var/lib/phpmyadmin/config.inc.php

    So if you need to make any changes, that file is where they should go. Comment out any similar entries in the /etc/phpmyadmin/config.inc.php file and your autoconfig changes will stick.

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More