Ubuntu 18.04 phpMyAdmin: Difference between revisions

From Modiford
Jump to navigation Jump to search
(Initial creation)
 
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
The open source phpMyAdmin administration tool provides access to maintenance and management of MySQL or MariaDB databases via the convenience of a web-based interface.  As such, it can be installed on a new or existing web server and is more-or-less accessible from anywhere, on any browser or mobile device.
= Installation Process=
= Installation Process=
The following covers installation of the latest '''phpMyAdmin''' from the main project website, rather than the often outdated Ubuntu repository or Snap packages.


== LAMP Stack ==
== LAMP Stack ==


The '''Linux Apache MySQL and PHP''' Stack, better known as LAMP, provides all the services for hosting a website using the programming language PHP.  Depending on the system, MariaDB might substitute MySQL.
The '''Linux Apache MySQL and PHP''' stack, better known by the acronym ''''LAMP'''', provides all the services for hosting a website using the programming language PHP.  Depending on the system, MariaDB might substitute MySQL.
 
If you have not yet installed the 'LAMP' stack, do the following:
 
The simplest way to install LAMP is with the all-in-one package via 'tasksel'; if not already installed, run 'sudo apt install tasksel'.
 
# In a terminal type 'sudo tasksel' and press '''<Enter>''';
# Navigate down to 'LAMP server' and press '''<Enter>''';
# The 'Installing packages' process will download and install the packages for you;
 
With Ubuntu 18.04 MySQL now needs additional tweaking to make it accessible:
 
# In a terminal type ''''sudo mysql -u root -p'''' and press ''''<Enter>'''';
# Type ''''use mysql;''' and press ''''<Enter>'''';
# Type ''''update user set Plugin='mysql_native_password' where User='root' and Host='localhost';'''' and press ''''<Enter>'''';
# Type ''''flush privileges;'''' and press ''''<Enter>'''';
# Type ''''exit''''  and press ''''<Enter>''''.
 
As observed above, there was no password for the 'root' user for MySQL access.  Run the following to specify one:
 
#  run 'sudo mysql_secure_installation' to specify a MySQL 'root' user password;
## Answer "'''Y'''";
## Select "'''1'''" for Medium or "2" for Strong as suits your security needs;
## Enter your chosen password and then re-enter to confirm;
## Answer "'''Y'''" to password strength (or otherwise specify a new password that matches the security requirements selected before);
## Answer "'''Y'''" to remove anonymous user accounts;
## Select appropriate answer depending on whether you wish to connect to MySQL from an external connection or not (usually not);
## Select whether you want to remove the 'test' database or not;
## Answer "'''Y'''" to reload the privileges;
 
== phpMyAdmin ==


The simplest way to install LAMP is with the all-in-one package via 'tasksel'; if not already installed, run 'sudo apt install tasksel'.
Visit the [https://www.phpmyadmin.net/downloads/ phpMyAdmin Downloads] page and right-click on the latest version you need in the '.tar.gz' format and select 'Copy Link Location' (or similar).  For example, "phpMyAdmin-4.8.2-english.tar.gz" at time of writing, or other language choice to suit your needs.  Substitute the name throughout the following as necessary.


# In a terminal type 'sudo tasksel' and press <Enter>;
# Open a new terminal and type ''''mkdir phpmyadmin'''' and press '''<Enter>''';
# Navigate down to 'LAMP server' and press <Enter>;
# Type ''''cd phpmyadmin'''' and press '''<Enter>''';
# The 'Installing packages' process will download and install the packages for you;
# Type ''''wget '''' and right-click and select 'Paste' (therefore, ''''wget https://files.phpmyadmin.net/phpMyAdmin/4.8.2/phpMyAdmin-4.8.2-english.tar.gz'''', as per your chosen download) and press '''<Enter>''';
## On Ubuntu 16.04 you will get prompted for a MySQL 'root' user password;
# Once downloaded, type ''''tar zxvf phpMyAdmin-4.8.2-english.tar.gz'''' and press '''<Enter>''';
## On Ubuntu 18.04, once installation is complete, run 'sudo mysql_secure_installation' to specify a MySQL 'root' user password;
# Once extracted, type ''''sudo mv phpMyAdmin-4.8.2-english /var/www/html/'''' and press '''<Enter>''';
### Answer "Y";
# Type ''''cd /var/www/html/'''' and press '''<Enter>''';
### Select "1" for Medium or "2" for Strong as suits your security needs;
# Type ''''sudo mv phpMyAdmin-4.8.2-english phpMyAdmin'''' and press '''<Enter>''' (or other name of your choosing, to be less obvious on a public website);
### Enter password and then re-enter to confirm;
# Very carefully execute the following command ''''sudo chown -R www-data:www-data /var/www/'''' and press '''<Enter>''';
### Answer "Y" to password strength (or otherwise specify a new password that matches the security requirements selected);
# Open a browser and navigate to your server's IP or DNS name, for example ''''http://192.168.0.10/phpMyAdmin/''''.
### Answer "Y" to remote anonymous user accounts;
### Select appropriate answer depending on whether you wish to connect to MySQL from an external connection or not;
### Select whether you want to remove the 'test' database or not;
### Answer "Y" to reload the privileges;





Latest revision as of 20:41, 29 July 2018

The open source phpMyAdmin administration tool provides access to maintenance and management of MySQL or MariaDB databases via the convenience of a web-based interface. As such, it can be installed on a new or existing web server and is more-or-less accessible from anywhere, on any browser or mobile device.

Installation Process

The following covers installation of the latest phpMyAdmin from the main project website, rather than the often outdated Ubuntu repository or Snap packages.

LAMP Stack

The Linux Apache MySQL and PHP stack, better known by the acronym 'LAMP', provides all the services for hosting a website using the programming language PHP. Depending on the system, MariaDB might substitute MySQL.

If you have not yet installed the 'LAMP' stack, do the following:

The simplest way to install LAMP is with the all-in-one package via 'tasksel'; if not already installed, run 'sudo apt install tasksel'.
  1. In a terminal type 'sudo tasksel' and press <Enter>;
  2. Navigate down to 'LAMP server' and press <Enter>;
  3. The 'Installing packages' process will download and install the packages for you;

With Ubuntu 18.04 MySQL now needs additional tweaking to make it accessible:

  1. In a terminal type 'sudo mysql -u root -p' and press '<Enter>';
  2. Type 'use mysql; and press '<Enter>';
  3. Type 'update user set Plugin='mysql_native_password' where User='root' and Host='localhost';' and press '<Enter>';
  4. Type 'flush privileges;' and press '<Enter>';
  5. Type 'exit' and press '<Enter>'.

As observed above, there was no password for the 'root' user for MySQL access. Run the following to specify one:

  1. run 'sudo mysql_secure_installation' to specify a MySQL 'root' user password;
    1. Answer "Y";
    2. Select "1" for Medium or "2" for Strong as suits your security needs;
    3. Enter your chosen password and then re-enter to confirm;
    4. Answer "Y" to password strength (or otherwise specify a new password that matches the security requirements selected before);
    5. Answer "Y" to remove anonymous user accounts;
    6. Select appropriate answer depending on whether you wish to connect to MySQL from an external connection or not (usually not);
    7. Select whether you want to remove the 'test' database or not;
    8. Answer "Y" to reload the privileges;

phpMyAdmin

Visit the phpMyAdmin Downloads page and right-click on the latest version you need in the '.tar.gz' format and select 'Copy Link Location' (or similar). For example, "phpMyAdmin-4.8.2-english.tar.gz" at time of writing, or other language choice to suit your needs. Substitute the name throughout the following as necessary.

  1. Open a new terminal and type 'mkdir phpmyadmin' and press <Enter>;
  2. Type 'cd phpmyadmin' and press <Enter>;
  3. Type 'wget ' and right-click and select 'Paste' (therefore, 'wget https://files.phpmyadmin.net/phpMyAdmin/4.8.2/phpMyAdmin-4.8.2-english.tar.gz', as per your chosen download) and press <Enter>;
  4. Once downloaded, type 'tar zxvf phpMyAdmin-4.8.2-english.tar.gz' and press <Enter>;
  5. Once extracted, type 'sudo mv phpMyAdmin-4.8.2-english /var/www/html/' and press <Enter>;
  6. Type 'cd /var/www/html/' and press <Enter>;
  7. Type 'sudo mv phpMyAdmin-4.8.2-english phpMyAdmin' and press <Enter> (or other name of your choosing, to be less obvious on a public website);
  8. Very carefully execute the following command 'sudo chown -R www-data:www-data /var/www/' and press <Enter>;
  9. Open a browser and navigate to your server's IP or DNS name, for example 'http://192.168.0.10/phpMyAdmin/'.