install_apache_mysql_php_linux_ubuntu_server
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
install_apache_mysql_php_linux_ubuntu_server [2020/06/08 16:36] – [Install MySQL Database Server] wikiadmin | install_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 164: | Line 164: | ||
< | < | ||
- | <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 | ||
- | secure enough. Would you like to setup VALIDATE PASSWORD component? | + | secure enough. Would you like to setup VALIDATE PASSWORD component?// |
- | 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 | + | |
- | Please enter 0 = LOW, 1 = MEDIUM | + | //MEDIUM Length >= 8, numeric, mixed case, and special characters// |
- | Please set the password for root here. | + | |
- | New password: | + | //STRONG Length >= 8, numeric, mixed case, special characters and dictionary file// |
- | Re-enter new password: | + | **Please |
- | Estimated strength of the password: 100 | + | //Please set the password for root here.// |
- | Do you wish to continue with the password provided? | + | |
- | By default, a MySQL installation has an anonymous user, | + | **New password: |
+ | |||
+ | **Re-enter new password: | ||
+ | |||
+ | //Estimated strength of the password: 100// | ||
+ | |||
+ | **Do you wish to continue with the password provided? | ||
+ | |||
+ | //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 | ||
testing, and to make the installation go a bit smoother. | testing, and to make the installation go a bit smoother. | ||
You should remove them before moving into a production | You should remove them before moving into a production | ||
- | environment. | + | environment.// |
- | Remove anonymous users? (Press y|Y for Yes, any other key for No) : y | + | **Remove anonymous users? (Press y|Y for Yes, any other key for No) : y** |
- | Success. | + | |
+ | // | ||
- | Normally, root should only be allowed to connect from | + | |
+ | //Normally, root should only be allowed to connect from | ||
' | ' | ||
- | the root password from the network. | + | the root password from the network.// |
- | Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y | + | **Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y** //(n should be considered)// |
- | Success. | + | |
- | By default, MySQL comes with a database named ' | + | // |
+ | |||
+ | //By default, MySQL comes with a database named ' | ||
anyone can access. This is also intended only for testing, | anyone can access. This is also intended only for testing, | ||
and should be removed before moving into a production | and should be removed before moving into a production | ||
- | environment. | + | environment.// |
+ | |||
+ | |||
+ | **Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y** | ||
+ | |||
+ | // - Dropping test database...// | ||
+ | |||
+ | // | ||
+ | |||
+ | ** - Removing privileges on test database...** | ||
+ | |||
+ | // | ||
+ | |||
+ | //Reloading the privilege tables will ensure that all changes | ||
+ | made so far will take effect immediately.// | ||
+ | |||
+ | **Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y** | ||
+ | |||
+ | // | ||
+ | |||
+ | //All done!// | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Installing phpMyAdmin ===== | ||
+ | |||
+ | phpMyAdmin is a web interface to manage MySQL databases and user privileges. | ||
+ | |||
+ | < | ||
+ | |||
+ | When prompted during installation, | ||
+ | |||
+ | 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? | ||
+ | |||
+ | < | ||
+ | Cannot log in to the MySQL server | ||
+ | |||
+ | mysqli_real_connect(): | ||
+ | |||
+ | Connection for controluser as defined in your configuration failed. | ||
+ | |||
+ | mysqli_real_connect(): | ||
+ | |||
+ | or | ||
+ | |||
+ | #1698 - Access denied for user ' | ||
+ | </ | ||
+ | ==== 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 ' | ||
+ | |||
+ | < | ||
+ | sudo mysql -u root -p | ||
+ | </ | ||
+ | |||
+ | **Enter password: | ||
+ | |||
+ | The SSH prompt should change to the MySQL console prompt that looks like this: | ||
+ | |||
+ | < | ||
+ | |||
+ | 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. | ||
+ | |||
+ | < | ||
+ | CREATE USER ' | ||
+ | |||
+ | CREATE USER ' | ||
+ | CREATE USER ' | ||
+ | </ | ||
- | Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y | + | So, for example, this should work (and ensure that you are logged into the console prompt at mysql> |
- | - Dropping test database... | + | |
- | Success. | + | |
- | - Removing privileges on test database... | + | < |
- | Success. | + | CREATE USER ' |
- | Reloading the privilege tables will ensure that all changes | + | </ |
- | made so far will take effect immediately. | + | |
- | Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y | + | Now, let's grant the new user named ' |
- | Success. | + | |
- | All done! | + | < |
- | </quote> | + | GRANT ALL PRIVILEGES ON *.* TO ' |
+ | </code> | ||
+ | And lastly, run this command: | ||
+ | < | ||
+ | FLUSH PRIVILEGES; | ||
+ | </ | ||
+ | Exit the MySQL console and return to the SSH user prompt, with the exit command: | ||
+ | < | ||
+ | Now, open your web browser and log into PhpMyAdmin through a webpage on a remote device with the username ' | ||
install_apache_mysql_php_linux_ubuntu_server.txt · Last modified: 2020/06/08 23:20 by wikiadmin