LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-04-2020, 10:29 PM   #1
pizzipie
Member
 
Registered: Jun 2005
Location: Hayden, ID
Distribution: Ubuntu 20.04
Posts: 441

Rep: Reputation: 12
Phpmyadmin - Can't get it to install


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
Attached Thumbnails
Click image for larger version

Name:	Selection_002.png
Views:	20
Size:	28.0 KB
ID:	34239  
 
Old 10-05-2020, 01:36 AM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
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.

Last edited by astrogeek; 10-05-2020 at 01:39 AM.
 
Old 10-05-2020, 10:09 AM   #3
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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?
 
Old 10-05-2020, 01:46 PM   #4
pizzipie
Member
 
Registered: Jun 2005
Location: Hayden, ID
Distribution: Ubuntu 20.04
Posts: 441

Original Poster
Rep: Reputation: 12
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
 
Old 10-05-2020, 01:55 PM   #5
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by pizzipie View Post
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.
 
Old 10-05-2020, 07:42 PM   #6
pizzipie
Member
 
Registered: Jun 2005
Location: Hayden, ID
Distribution: Ubuntu 20.04
Posts: 441

Original Poster
Rep: Reputation: 12
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????

Last edited by pizzipie; 10-05-2020 at 07:44 PM.
 
Old 10-05-2020, 08:17 PM   #7
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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
 
Old 10-06-2020, 01:33 AM   #8
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
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.
 
1 members found this post helpful.
Old 10-06-2020, 11:19 AM   #9
pizzipie
Member
 
Registered: Jun 2005
Location: Hayden, ID
Distribution: Ubuntu 20.04
Posts: 441

Original Poster
Rep: Reputation: 12
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.
 
1 members found this post helpful.
Old 10-06-2020, 01:37 PM   #10
Steve R.
Member
 
Registered: Jun 2009
Location: Morehead City, NC
Distribution: Mint 20.3
Posts: 521

Rep: Reputation: 98
Quote:
Originally Posted by pizzipie View Post
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".

Last edited by Steve R.; 10-06-2020 at 02:35 PM.
 
Old 10-06-2020, 05:44 PM   #11
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by scasey View Post
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.
 
Old 10-06-2020, 10:54 PM   #12
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
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).
 
Old 10-10-2020, 06:08 PM   #13
pizzipie
Member
 
Registered: Jun 2005
Location: Hayden, ID
Distribution: Ubuntu 20.04
Posts: 441

Original Poster
Rep: Reputation: 12
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/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PhpMyAdmin completly installed but can not connect to Server (IP/phpmyadmin) DKI Linux - Newbie 4 11-22-2014 08:51 AM
phpMyAdmin error: client denied by server configuration: /usr/share/phpMyAdmin Kropotkin Linux - Server 2 05-15-2010 12:55 PM
phpmyadmin shows blank page; no "phpmyadmin" database in mysql qajaq Linux - Software 2 12-20-2009 12:23 PM
phpMyAdmin can't get it to my http folder shorto Linux - Newbie 3 07-06-2007 09:47 PM
Can't get phpmyadmin to work, php works dfuse Linux - Networking 2 12-05-2003 02:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration