LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Phpmyadmin - Can't get it to install (https://www.linuxquestions.org/questions/linux-software-2/phpmyadmin-cant-get-it-to-install-4175683174/)

pizzipie 10-04-2020 10:29 PM

Phpmyadmin - Can't get it to install
 
1 Attachment(s)
Hi,

Using Ubuntu 18.04.

I have tried to install phpmyadmin a dozen times now and can't get past the point where the actual install takes place. I get " Error 1045 Access denied for 'root'@'localhost' (using password: NO)" This 'using password NO' is a mysql message; there is no place to put mysql -u user -p password!!!

I accepted the database for phpmyadmin and want my Mariadb user 'rick' to be the man-in-charge. I don't know what to put in for phpmyadmin password. I used to be that you put in whatever MySql user password you would use to access your databases and away you go.

Thanks in advance in help with this.

Totally frustrated after many hours!!

R

astrogeek 10-05-2020 01:36 AM

As no one else has stepped up I'll see if I can point you in the right direction...

Disclaimer: I am not an Ubuntu user and unfamiliar with its package manager, and would never install a PHP application from a package manager anyway, so I'll point you elsewhere for that...

A quick web search turned up this DigitalOcean page which appears to have the details you need to figure this out. I assume you are running this on your local machine not accessible from the interwebs, but if not then heed security advice given there also.

Once past the point that phpmyadmin code is installed to your web server root, you need two things to happen for it to access MySQL:

1. MySQL/Mariadb must have a GRANT for the user you want to access the database.

If unsure then open a MySQL client for your admin or root user (ex: mysql -p -u root) and ask it whether rick has permission:
Code:

> show grants for rick@localhost;
If not then add a GRANT for that user for the database(s) you intend to use with phpmyadmin:

Code:

GRANT ALL ON db-name-here.* TO rick@localhost IDENTIFIED BY 'password-here';
2. You must add the user, password and db-name(s) to the phpmyadmin config file. It may ask you for that when you try to open the page in your browser, or you may need to edit the file directly. I am not sure where they put that on Ubuntu so look at the docs or search online. It should be in the PHP code installed by the package manager. When you find it, add your user credentials and db name per your installation.

scasey 10-05-2020 10:09 AM

To add to what astrogeek said, it's important to understand that phpmyadmin has no security of its own. It uses the already defined security of the the mysql installation. Out of the box, the root user to mysql has no password.
Where did you install phpmyadmin from? I use my distro's repositories (epel) to install it.
Have you reviewed the installation instructions for phpmyamin?

pizzipie 10-05-2020 01:46 PM

Thanks for replies,

I have checked out site(s) refered to and can find no answer. Here is the Mariadb(mysql) status info that maybe can help you help me. I have a root user with password and a rick user with password. They are both accessible in mysql with no problem. Both show authentication_string and mysql_native_password entries in mysql.user.


Quote:

rick@rick-MS-7C02:~$ sudo systemctl status mariadb
● mariadb.service - MariaDB 10.1.44 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-10-05 09:09:16 PDT; 2h 13min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Main PID: 1080 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 27 (limit: 4915)
CGroup: /system.slice/mariadb.service
└─1080 /usr/sbin/mysqld

Oct 05 09:09:15 rick-MS-7C02 systemd[1]: Starting MariaDB 10.1.44 database server...
Oct 05 09:09:16 rick-MS-7C02 mysqld[1080]: 2020-10-05 9:09:16 140141176859776 [Note] /usr/sbin/mysqld (mysqld 10.1.44-MariaDB-0ubuntu0.18.04.1) starting as process 1080
Oct 05 09:09:16 rick-MS-7C02 systemd[1]: Started MariaDB 10.1.44 database server.
Oct 05 09:09:16 rick-MS-7C02 /etc/mysql/debian-start[1166]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Oct 05 09:09:16 rick-MS-7C02 /etc/mysql/debian-start[1166]: Looking for 'mysql' as: /usr/bin/mysql
Oct 05 09:09:16 rick-MS-7C02 /etc/mysql/debian-start[1166]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Oct 05 09:09:16 rick-MS-7C02 /etc/mysql/debian-start[1166]: Version check failed. Got the following error when calling the 'mysql' command line client
Oct 05 09:09:16 rick-MS-7C02 /etc/mysql/debian-start[1166]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Oct 05 09:09:16 rick-MS-7C02 /etc/mysql/debian-start[1166]: FATAL ERROR: Upgrade failed


scasey 10-05-2020 01:55 PM

Quote:

Originally Posted by pizzipie (Post 6172853)
Thanks for replies,

I have checked out site(s) refered to and can find no answer. Here is the Mariadb(mysql) status info that maybe can help you help me. I have a root user with password and a rick user with password. They are both accessible in mysql with no problem. Both show authentication_string and mysql_native_password entries in mysql.user.

[/B]

Not sure what those errors have to do with installing phpmyadmin. Those errors are from mysql doing an upgrade.
If you are trying to upgrade phpmyadmin, the instructions are here.

pizzipie 10-05-2020 07:42 PM

Thanks scasey

scasey:
Quote:

Not sure what those errors have to do with installing phpmyadmin.

Oct 05 09:09:16 rick-MS-7C02 /etc/mysql/debian-start[1166]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
That error shows up in the installation of phpmyadmin just after you enter all password info.

astrogeek:
Quote:

You must add the user, password and db-name(s) to the phpmyadmin config file. It may ask you for that when you try to open the page in your browser, or you may need to edit the file directly.
Phpmyadmin Will not install so how can one edit the config file??



pizzipie:
Quote:

rick@rick-MS-7C02:~$ mysql -uroot -pmypassword

Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 10.1.44-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]>

MySql using root seems to be ok, eh????

scasey 10-05-2020 08:17 PM

Your error says that the upgrade is not using the password
Code:

Access denied for user 'root'@'localhost' (using password: NO)
You need to figure out why.
Have you reviewed the documentation and wiki?

One Idea: remove the password from the MySQL root user temporarily
Another: Run the installation as the Rick user

astrogeek 10-06-2020 01:33 AM

Let's back up a little...

It appears to me that you have descended into the dependency nether regions so that while attempting to install a PHP script your system is trying to install or update MySQL first, so we haven't even gotten to phpmyadmin yet.

Please tell us, is your web server already installed, configured and running on this machine, or is this a bare new setup?

You appear able to login to the MySQL client as the root MySQL user, are you actually using MySQL at this time or is that being setup for the first time as well? Have you ever configured a "rick" user or "root" user on MySQL? (These are NOT system user accounts but belong entirely to MySQL. Many systems attempt to create a "root" user in MySQL by default, but it will NOT have a password set unless you explicitly do that... have you? If you have not created a "rick" user in MySQL there will not be one simply because there is a rick login to the system - they are not the same).

And one we haven't gotten to yet - if the web server is configured and running, is it already serving any PHP content? In other words, do we have any confidence that PHP will be processed correctly?

One reason I said that I would never install a PHP script from the package manager is that it tends to trigger an avalance of problems due to the packager's choices of dependencies and configurations and it really is not a thing that the package manager should even be aware of, IMO, much less in control of. It is better thought of as web server "content", not a system application. But, that is just me...

Regardless, let's make sure your MySQL and your web server and PHP are already working before we think about whether and why phpmyadmin may not be working.

pizzipie 10-06-2020 11:19 AM

Quote:

Please tell us, is your web server already installed, configured and running on this machine, or is this a bare new setup?
I recently installed the LAMP group after building this new computer. Apache2 index runs properly.

Quote:

You appear able to login to the MySQL client as the root MySQL user, are you actually using MySQL at this time
MySql/Mariadb: I created user 'rick' from 'root' using a 'root' password and GRANTED 'rick' All privileges. So, yes' I do have a user 'rick' and I have loaded an sql file creating a new 'states' database successfully with user 'rick'.

Quote:

And one we haven't gotten to yet - if the web server is configured and running, is it already serving any PHP content? In other words, do we have any confidence that PHP will be processed correctly?
PHP: I have installed Sqlite3 and use PHP to access the sqlite databases with 'sqlite-php' commands with no problems.

Quote:

Regardless, let's make sure your MySQL and your web server and PHP are already working ...
From this I would say that Apache2, MySql/Mariadb, and PHP are working correctly.

Steve R. 10-06-2020 01:37 PM

Quote:

Originally Posted by pizzipie (Post 6172664)
I have tried to install phpmyadmin a dozen times now and can't get past the point where the actual install takes place. I get " Error 1045 Access denied for 'root'@'localhost' (using password: NO)" This 'using password NO' is a mysql message; there is no place to put mysql -u user -p password!!!

Did the install of phpmyadmin completely fail in that the program is not accessible or is that you cannot login as "root"? If it is the situation were you can't login as "root"; can you login as "rick"? If you can login as "rick", go to "User Accounts" in phpmyadmin and assign "root" a password.

On the previous post you wrote: "I created user 'rick' from 'root' using a 'root' password and GRANTED 'rick' All privileges.". That should give you the capability to assign "root" password in phpmyadmin, assuming you can login as "rick".

scasey 10-06-2020 05:44 PM

Quote:

Originally Posted by scasey (Post 6172935)
Your error says that the upgrade is not using the password
Code:

Access denied for user 'root'@'localhost' (using password: NO)
You need to figure out why.
r

I think my point got missed:
If you
Code:

$ mysql -uroot
(no -p)
You will get that same Access denied message!
That message is reporting that the attempt to login did not supply a password, not that the password was incorrect.

As an aside, when using the -p option to mysql supplying the password on the command line may allow it to be seen in ps output, and will certainly preserve it in history. If you
Code:

$ mysql -uroot -p
mysql will prompt for the password, the entry won't echo (as when logging into a console or terminal), and it won't be saved anywhere.

astrogeek 10-06-2020 10:54 PM

OK, thanks for the reply pizipie! Your web server is running and configured for PHP, and MySQL is working with the necessary user access - that gives us confidence to move ahead.

Which brings us full circle to how the package was configured and why the installer is balking at MySQL. Unfortunately, I can not offer much help with that because of unfamiliarity with the Ubuntu package repo.

As an alternative, I would suggest not installing it from your package manager for reasons I have already given.

Instead I would suggest simply downloading the current version from the phpmyadmin website, then installing it according to the documentation given there, especially the Quick Install page.

Basically, after veirfying the package checksum, simply untar or unzip the archive in your web server root and adding the necessary credentials to the config.inc.php file - done...

If you decide you prefer to use the distro package instead, simply delete the directories and files created when the archive was opened - done. Then install from the package manager (it will probably recognize and use the same DB after you again edit the new config.inc.php, or the equivalent file used by your package manager).

pizzipie 10-10-2020 06:08 PM

I fixed it !!!!!. Got rid of Ubuntu 18.04 and installed Ubuntu 20.04. Thank you all for all your Time and Effort on my behalf.

Quote:

I found this site on the internet and followed the instructions to letter, First reading it ALL.

https://www.tecmint.com/install-lamp...-ubuntu-20-04/


All times are GMT -5. The time now is 10:02 AM.