Install Config Wiki

All about installing, configuring and troubleshooting

User Tools

Site Tools


install_apache_mysql_php_linux_ubuntu_server

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
install_apache_mysql_php_linux_ubuntu_server [2020/06/08 18:02] – [Install MySQL Database Server] wikiadmininstall_apache_mysql_php_linux_ubuntu_server [2020/06/08 23:20] (current) – [Create a new admin user or new root user and password with PhpMyAdmin access from any IP remotely] wikiadmin
Line 165: Line 165:
  
 <QUOTE> <QUOTE>
-//Securing the MySQL server deployment.+//Securing the MySQL server deployment.//
  
-Connecting to MySQL using a blank password.+//Connecting to MySQL using a blank password.//
  
-VALIDATE PASSWORD COMPONENT can be used to test passwords+//VALIDATE PASSWORD COMPONENT can be used to test passwords
 and improve security. It checks the strength of password and improve security. It checks the strength of password
 and allows the users to set only those passwords which are and allows the users to set only those passwords which are
Line 176: Line 176:
 **Press y|Y for Yes, any other key for No: y** **Press y|Y for Yes, any other key for No: y**
  
-//There are three levels of password validation policy:+//There are three levels of password validation policy://
  
-LOW    Length >= 8 +//LOW    Length >= 8// 
-MEDIUM Length >= 8, numeric, mixed case, and special characters + 
-STRONG Length >= 8, numeric, mixed case, special characters and dictionary file//+//MEDIUM Length >= 8, numeric, mixed case, and special characters// 
 + 
 +//STRONG Length >= 8, numeric, mixed case, special characters and dictionary file//
  
 **Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2** **Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2**
 +
 //Please set the password for root here.// //Please set the password for root here.//
  
Line 189: Line 192:
 **Re-enter new password:** **Re-enter new password:**
  
-//Estimated strength of the password: 100 +//Estimated strength of the password: 100// 
-Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y + 
-By default, a MySQL installation has an anonymous user,+**Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y** 
 + 
 +//By default, a MySQL installation has an anonymous user,
 allowing anyone to log into MySQL without having to have allowing anyone to log into MySQL without having to have
 a user account created for them. This is intended only for a user account created for them. This is intended only for
Line 218: Line 223:
  
 **Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y** **Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y**
- - Dropping test database...+ 
 +// - Dropping test database...//
  
 //Success.// //Success.//
  
- - Removing privileges on test database...+** - Removing privileges on test database...**
  
 //Success.// //Success.//
Line 232: Line 238:
  
 //Success.// //Success.//
 +
 +//All done!//
  
 </QUOTE> </QUOTE>
  
 +===== Installing phpMyAdmin =====
 +
 +phpMyAdmin is a web interface to manage MySQL databases and user privileges.  Install phpMyAdmin on Ubuntu 20.04 LTS as follows:
 +
 +<code>sudo apt install phpmyadmin</code>
 +
 +When prompted during installation, select "Apache" as the web server running phpMyAdmin.
 +
 +When prompted to create the phpMyAdmin database, provide your admin user access details and take the remaining steps to complete the installation.
 +
 +===== Workaround Errors in setting up phpmyadmin@localhost with all privileges involving dbconfig-common =====
 +
 +
 +Are you getting errors when trying to login to PhpMyAdmin as root?
 +
 +<QUOTE>
 +Cannot log in to the MySQL server
 +
 +mysqli_real_connect(): (HY000/1045): Access denied for user 'phpmyadmin'@'localhost' (using password: YES)
 +
 +Connection for controluser as defined in your configuration failed.
 +
 +mysqli_real_connect(): (HY000/1698): Access denied for user 'root'@'localhost'
 +
 +or
 +
 +#1698 - Access denied for user 'root'@'localhost'
 +</QUOTE> 
 +==== Create a new PhpMyAdmin root user and password having PhpMyAdmin access from any IP remotely ====
 +
 +Using SSH access to the Ubuntu Server, log into the mysql console using as the MySQL user 'root' and with the password for the user root that was established when installing MySQL database server on Ubuntu.  This will put you/us into the prompt for the console mysql>
 +
 +<code>
 +sudo mysql -u root -p
 +</code>
 +
 +**Enter password:**
 +
 +The SSH prompt should change to the MySQL console prompt that looks like this:
 +
 +<QUOTE>mysql></QUOTE>
 +
 +Now, create a new MySQL admin/root user with all privileges including GRANT privileges and make sure that the user can login from any IP remotely rather than only having privileges from @localhost. There are 3 choices of commands in the code block below for creating a new user from the MySQL console prompt; however, only the third choice may actually allow for logging into PhpMyAdmin as a root user from any remote IP.
 +
 +<code>
 +CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
 +
 +CREATE USER 'username'@'ip_address' IDENTIFIED BY 'password';
 +
 +CREATE USER 'username'@'%' IDENTIFIED BY 'password';
 +</code>
 +
 +So, for example, this should work (and ensure that you are logged into the console prompt at mysql>
 +
 +<code>
 +CREATE USER 'rootuser'@'%' IDENTIFIED BY 'YourComplex#54321Pwd!';
 +
 +</code>
 +
 +Now, let's grant the new user named 'rootuser' all privileges including the Grant Option, like this:
 +
 +<code>
 +GRANT ALL PRIVILEGES ON *.* TO 'rootuser'@'%' WITH GRANT OPTION;
 +</code>
 +
 +And lastly, run this command:
  
 +<code>
 +FLUSH PRIVILEGES;
 +</code>
  
 +Exit the MySQL console and return to the SSH user prompt, with the exit command:
  
 +<QUOTE>mysql> exit</QUOTE>
  
 +Now, open your web browser and log into PhpMyAdmin through a webpage on a remote device with the username 'rootuser' and the password you installed for rootuser. You should have success now. 
    
install_apache_mysql_php_linux_ubuntu_server.1591639345.txt.gz · Last modified: 2020/06/08 18:02 by wikiadmin