0172.html 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Install phpMyAdmin on LAMP (Linux Apache MySQL PHP)</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Linux,PHP,MySQL,Web Based Tools,Web Based Administration,Database Administration,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Install phpMyAdmin on LAMP (Linux Apache MySQL PHP)">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="05/23/2022 08:51:11 PM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Install phpMyAdmin on LAMP (Linux Apache MySQL PHP)</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is phpMyAdmin?</h2>
  26. <blockquote><em>phpMyAdmin is a free software tool written in PHP, intended to handle the administration of MySQL over the Web. -<a href="https://www.phpmyadmin.net" target="_blank">https://www.phpmyadmin.net</a></em></blockquote>
  27. <p>This tutorial assumes a working Apache2, PHP and MySQL/MariaDB environment is already installed</p>
  28. <ol>
  29. <li>Log into the Linux machine</li>
  30. <li>Run the following commands in terminal to install phpMyAdmin:
  31. <div class="codeBlock"># update apt repositories<br />
  32. sudo apt update<br />
  33. sudo apt upgrade<br />
  34. # download latest phpMyAdmin<br />
  35. wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-english.tar.gz<br />
  36. # create phpmyadmin directory in web root<br />
  37. sudo mkdir /var/www/html/phpmyadmin<br />
  38. # extract the downloaded phpMyAdmin to the folder created<br />
  39. sudo tar xvf phpMyAdmin-latest-english.tar.gz --strip-components=1 -C /var/www/html/phpmyadmin<br />
  40. # create a copy of the sample config file<br />
  41. <span style="display: none;"> </span><span style="display: none;"> </span><span style="display: none;"> </span><span style="display: none;"> </span>sudo cp /var/www/html/phpmyadmin/config.sample.inc.php /var/www/html/phpmyadmin/config.inc.php<br />
  42. <span style="display: none;"> </span><span style="display: none;"> </span># set folder owner<br />
  43. <span style="display: none;"> </span><span style="display: none;"> </span>sudo chown www-data:www-data /var/www/html/phpmyadmin<br />
  44. # restart apache service<br />
  45. sudo systemctl restart apache2<br />
  46. # connect to MySQL and create a user to use with phpMyAdmin<br />
  47. sudo su<br />
  48. mysql -u root<br />
  49. <span style="display: none;"> </span>CREATE USER &#39;i12bretro&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;some_very_complex_password&#39;;<br />
  50. GRANT ALL PRIVILEGES ON * . * TO &#39;i12bretro&#39;@&#39;localhost&#39;;<br />
  51. FLUSH PRIVILEGES;</div>
  52. </li>
  53. <li>Once the installation completes, open a web browser and navigate to http://DNSorIP/phpmyadmin</li>
  54. <li>Log in using the user created in the steps above</li>
  55. <li>Enjoy visual browser based control over MySQL/MariaDB</li>
  56. </ol>
  57. </div>
  58. </div>
  59. </body>
  60. </html>