0172.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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,i12bretro,Tutorial,How To">
  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. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  12. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  13. <script type="text/javascript" src="includes/js/steps.js"></script>
  14. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  15. </head>
  16. <body>
  17. <div id="gridContainer">
  18. <div class="topMargin"></div>
  19. <div id="listName" class="topMargin">
  20. <h1>Install phpMyAdmin on LAMP (Linux Apache MySQL PHP)</h1>
  21. </div>
  22. <div></div>
  23. <div id="content">
  24. <h2>What is phpMyAdmin?</h2>
  25. <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>
  26. <p>This tutorial assumes a working Apache2, PHP and MySQL/MariaDB environment is already installed</p>
  27. <ol>
  28. <li>Log into the Linux machine</li>
  29. <li>Run the following commands in terminal to install phpMyAdmin:
  30. <div class="codeBlock"># update apt repositories<br />
  31. sudo apt update<br />
  32. sudo apt upgrade<br />
  33. # download latest phpMyAdmin<br />
  34. wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-english.tar.gz<br />
  35. # create phpmyadmin directory in web root<br />
  36. sudo mkdir /var/www/html/phpmyadmin<br />
  37. # extract the downloaded phpMyAdmin to the folder created<br />
  38. sudo tar xvf phpMyAdmin-latest-english.tar.gz --strip-components=1 -C /var/www/html/phpmyadmin<br />
  39. # create a copy of the sample config file<br />
  40. <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 />
  41. <span style="display: none;"> </span><span style="display: none;"> </span># set folder owner<br />
  42. <span style="display: none;"> </span><span style="display: none;"> </span>sudo chown www-data:www-data /var/www/html/phpmyadmin<br />
  43. # restart apache service<br />
  44. sudo systemctl restart apache2<br />
  45. # connect to MySQL and create a user to use with phpMyAdmin<br />
  46. sudo su<br />
  47. mysql -u root<br />
  48. <span style="display: none;"> </span>CREATE USER &#39;i12bretro&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;some_very_complex_password&#39;;<br />
  49. GRANT ALL PRIVILEGES ON * . * TO &#39;i12bretro&#39;@&#39;localhost&#39;;<br />
  50. FLUSH PRIVILEGES;</div>
  51. </li>
  52. <li>Once the installation completes, open a web browser and navigate to http://DNSorIP/phpmyadmin</li>
  53. <li>Log in using the user created in the steps above</li>
  54. <li>Enjoy visual browser based control over MySQL/MariaDB</li>
  55. </ol>
  56. </div>
  57. </div>
  58. </body>
  59. </html>