timcurtin
Posts: 1
Joined: Tue Aug 06, 2019 5:57 pm

install Mysql-Server and client, php5, apache

Tue Aug 06, 2019 6:14 pm

Hello, I am new to RPI and just received, and got up running, yesterday, my RPI v3 B+ (all out of stock nation-wide on the RPI 4 Model B... I got vnc gui and ssh setup and can log in fine remotely, but my BIG ISSUE is when I try the following, I cannot install mysql, php or mysql client. ny help is apprreciated. BTW: I am running raspbian of course

I typed at command line:
(To install Mysql-Server and client, php5, apache

sudo apt-get install apache2 mysql-server php5 mysql-client

BUT... I keep getting [package name ie mysql-server has no installation candidate"
see full screen copy of results of my cmd line installation attempt below

WHAT DO I NEED TO DO TO INSTALL APACHE2, MYSQL SERVER AND CLIENT AS WELL AS PHP5???
Again, thanks in advanced...

results:
sudo apt-get install apache2 mysql-server php5 mysql-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package mysql-client is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
mariadb-client-10.0

Package php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package mysql-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
mariadb-server-10.0

E: Package 'mysql-server' has no installation candidate
E: Package 'php5' has no installation candidate
E: Package 'mysql-client' has no installation candidate

fruitoftheloom
Posts: 21105
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: install Mysql-Server and client, php5, apache

Wed Aug 07, 2019 5:41 am

timcurtin wrote:
Tue Aug 06, 2019 6:14 pm
Hello, I am new to RPI and just received, and got up running, yesterday, my RPI v3 B+ (all out of stock nation-wide on the RPI 4 Model B... I got vnc gui and ssh setup and can log in fine remotely, but my BIG ISSUE is when I try the following, I cannot install mysql, php or mysql client. ny help is apprreciated. BTW: I am running raspbian of course

I typed at command line:
(To install Mysql-Server and client, php5, apache

sudo apt-get install apache2 mysql-server php5 mysql-client

BUT... I keep getting [package name ie mysql-server has no installation candidate"
see full screen copy of results of my cmd line installation attempt below

WHAT DO I NEED TO DO TO INSTALL APACHE2, MYSQL SERVER AND CLIENT AS WELL AS PHP5???
Again, thanks in advanced...

results:
sudo apt-get install apache2 mysql-server php5 mysql-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package mysql-client is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
mariadb-client-10.0

Package php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package mysql-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
mariadb-server-10.0

E: Package 'mysql-server' has no installation candidate
E: Package 'php5' has no installation candidate
E: Package 'mysql-client' has no installation candidate

Yes MySQL has been replaced by MariaDB, I presume you are running Raspbian Buster fully updated ??

Code: Select all

sudo apt update
sudo apt install apache2 mariadb-server-10.3 php mariadb-client-10.3
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

nigelbartlett1
Posts: 32
Joined: Mon May 06, 2019 9:39 am
Location: London UK

Re: install Mysql-Server and client, php5, apache

Wed Aug 07, 2019 5:44 am

You don’t say, but I assume you are trying to install on Raspbian Buster. If so:

Code: Select all

sudo apt update
sudo apt -y install default-mysql-client default-mysql-server apache2 php php-mysql
Buster comes with PHP 7.3. Version 5 is no longer maintained.

Bosse_B
Posts: 836
Joined: Thu Jan 30, 2014 9:53 am

Re: install Mysql-Server and client, php5, apache

Sun Aug 25, 2019 6:57 am

Coming here because I hve failed to install phpmyadmin on an Ubuntu 18.04 box, always getting the login error message:

Code: Select all

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
And even though I installed php 7.3 the system still uses php 7.0

So now I gave up and decided to instead use a fresh RPi4 unit as the host for my LAMP server....

But now I see several suggestions here on how to do it:

Code: Select all

sudo apt update
sudo apt install apache2 mariadb-server-10.3 php mariadb-client-10.3
and

Code: Select all

sudo apt update
sudo apt -y install default-mysql-client default-mysql-server apache2 php php-mysql
They differ in several ways, one specifies a specific mariadb version and the other "default", why?
I want to install apache2, php 7.3, mariadb, phpmyadmin - how do I do this correctly so that I have the latest versions of everything?

Is there an authoritative HOWTO for installing LAMP (latest version) on Raspberry Pi4 (or Pi3)?
Bo Berglund
Sweden

User avatar
rpdom
Posts: 15615
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: install Mysql-Server and client, php5, apache

Sun Aug 25, 2019 7:46 am

The one that installs just "mariadb" and "mariadb-client" should install the latest fully-supported version rather than specifying the version.

nigelbartlett1
Posts: 32
Joined: Mon May 06, 2019 9:39 am
Location: London UK

Re: install Mysql-Server and client, php5, apache

Sun Aug 25, 2019 7:48 am

The advice from different people often differs because there are different ways to achieve the same result. I believe that either of the proffered suggestions would result in the same level of MariaDB being installed.

Also, I suggest you pick one set of instructions and try it. If it doesn’t work then post back here with your error message.

Last point, the above instructions are for Raspbian Buster. If you are trying to apply them to a different OS then you are unlikely to get support for that here.

Bosse_B
Posts: 836
Joined: Thu Jan 30, 2014 9:53 am

Re: install Mysql-Server and client, php5, apache

Sun Aug 25, 2019 9:21 am

nigelbartlett1 wrote:
Sun Aug 25, 2019 7:48 am
Last point, the above instructions are for Raspbian Buster. If you are trying to apply them to a different OS then you are unlikely to get support for that here.
I noticed the title of the thread saying php5 even though it was started 2019-08-06...
I know that php5 is no longer supported so installing php will probably get me the latest 7.x version, right?
And my system is a brand new RPi4 with Buster for sure!
Bo Berglund
Sweden

nigelbartlett1
Posts: 32
Joined: Mon May 06, 2019 9:39 am
Location: London UK

Re: install Mysql-Server and client, php5, apache

Sun Aug 25, 2019 10:12 am

What you will get is the version of the package available in the version of Raspbian you have installed. For Buster this is PHP 7.3 as stated in my original response. This is the latest version of PHP, but probably not the latest sub-release eg 7.3.x where x differs between latest and that installed with Raspbian.

If you ask the same question in a years time then the answer will be the same, except that it is quite likely that 7.3 will then no longer be the latest version.

fbe
Posts: 542
Joined: Thu Aug 17, 2017 9:08 pm

Re: install Mysql-Server and client, php5, apache

Sun Aug 25, 2019 7:03 pm

Bosse_B wrote:
Sun Aug 25, 2019 6:57 am
Coming here because I hve failed to install phpmyadmin on an Ubuntu 18.04 box, always getting the login error message:

Code: Select all

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
And even though I installed php 7.3 the system still uses php 7.0
Did you get the error message during phpmyadmin installation?
With Raspbian Buster you will get the following error message:

Code: Select all

Package configuration

  ┌────────────────────────┤ Configuring phpmyadmin ├────────────────────────┐
  │                                                                          │
  │ An error occurred while installing the database:
  │
  │ ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
  │ password: NO) . Your options are:
  │  * abort - Causes the operation to fail; you will need to downgrade,
  │    reinstall, reconfigure this package, or otherwise manually intervene
  │    to continue using it. This will usually also impact your ability to
  │    install other packages until the installation failure is resolved.
  │  * retry - Prompts once more with all the configuration questions
  │    (including ones you may have missed due to the debconf priority
  │    setting) and makes another attempt at performing the operation.
  │  * retry (skip questions) - Immediately attempts the operation again,
  │    skipping all questions. This is normally useful only if you have
  │
  │                                  <Ok>
  │                                                                          │
  └──────────────────────────────────────────────────────────────────────────┘

if you enable native password authentication for [email protected] before installing phpmyadmin. I would not recommend to enable it at all.

Code: Select all

zless /usr/share/doc/mariadb-server-10.3/README.Debian.gz
Then scroll down to
* ROOT USER AUTHENTICATION VIA UNIX SOCKET
Avoid instructions that advise you to run mysql_secure_installation for installations from Debian/Raspbian Stretch or later packages.

Return to “Networking and servers”