{"id":5910,"date":"2021-03-12T05:49:53","date_gmt":"2021-03-12T05:49:53","guid":{"rendered":"https:\/\/miloserdov.org\/?p=5910"},"modified":"2021-03-16T10:23:30","modified_gmt":"2021-03-16T10:23:30","slug":"installing-and-configuring-mysql-and-phpmyadmin-on-kali-linux","status":"publish","type":"post","link":"https:\/\/miloserdov.org\/?p=5910","title":{"rendered":"Installing and configuring MySQL and phpMyAdmin on Kali Linux"},"content":{"rendered":"<div class=\"0b20205ac99e89c6cabdb919fd9d1a8a\" data-index=\"1\" style=\"float: none; margin:10px 0 10px 0; text-align:center;\">\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block; text-align:center;\"\r\n     data-ad-format=\"fluid\"\r\n     data-ad-layout=\"in-article\"\r\n     data-ad-client=\"ca-pub-7219829351026140\"\r\n     data-ad-slot=\"9942251718\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\r\n\r\n\n<\/div>\n<h2 style=\"text-align: justify;\">\n\tTable of contents<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\t<a href=\"#1\">1. What is MySQL for<\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"#2\">2. MySQL client and server<\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"#3\">3. Installing MySQL on Kali Linux<\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"#4\">4.&nbsp;Kali Linux replaced MySQL with MariaDB<\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"#5\">5.&nbsp;Setting up MySQL on Kali Linux<\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"#6\">6.&nbsp;Starting and enabling MySQL autorun<\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"#7\">7.&nbsp;Setting and changing the MySQL password. Reset forgotten MySQL\/MariaDB password<\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"#8\">8.&nbsp;How to connect to MySQL server<\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"#9\">9.&nbsp;How to change MySQL user password in Kali Linux<\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"#10\">10.&nbsp;No password and empty MySQL password<\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"#11\">11.&nbsp;How to install phpMyAdmin on Kali Linux<\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"#12\">12.&nbsp;How to change phpMyAdmin URL<\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"#13\">13.&nbsp;Error &ldquo;Login without a password is forbidden by configuration (see AllowNoPassword)&rdquo;<\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"#14\">14.&nbsp;How to use phpMyAdmin on Kali Linux<\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"#15\">15.&nbsp;phpMyAdmin alternative<\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"#16\">16.&nbsp;Additional MySQL Resources<\/a>\n<\/p>\n<hr \/>\n<h2 style=\"text-align: justify;\">\n\t<a id=\"1\" name=\"1\"><\/a>What is MySQL for<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\tMySQL is a database management system that allows you to create, store, modify databases. It is often used in conjunction with PHP to store website databases. It can also be used as a data store for any program or tool.\n<\/p>\n<p style=\"text-align: justify;\">\n\tphpMyAdmin is a web application written in PHP that is a graphical interface for MySQL that allows you to work with data, including viewing, modifying, importing and exporting data in a web interface. phpMyAdmin requires a web server (Apache), as well as PHP and MySQL.\n<\/p>\n<p style=\"text-align: justify;\">\n\tThis tutorial will help you better understand MySQL and use it to work with databases. We will also install and configure phpMyAdmin to get a graphical database management interface. Using this knowledge, you can, for example, run a site on a local computer, deploy a site using a database from a backup.\n<\/p>\n<h2 style=\"text-align: justify;\">\n\t<a id=\"2\" name=\"2\"><\/a>MySQL client and server<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\tMySQL has two main components: server and client.\n<\/p>\n<p style=\"text-align: justify;\">\n\tThe MySQL server is the DBMS that powers the databases. The server is required for the database to work.\n<\/p>\n<p style=\"text-align: justify;\">\n\tMySQL client is a utility for connecting to a server. The client is needed if you want to connect to the MySQL server on the command line.\n<\/p>\n<h2 style=\"text-align: justify;\">\n\t<a id=\"3\" name=\"3\"><\/a>Installing MySQL on Kali Linux<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\tIf you have already worked with Debian derivatives (Linux Mint, Ubuntu), then there are two packages in them:\n<\/p>\n<ul>\n<li style=\"text-align: justify;\">\n\t\t<strong>mysql-server<\/strong> &#8211; MySQL server\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t<strong>mysql-client <\/strong>&#8211; MySQL client\n\t<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\n\tBy default, MySQL is already preinstalled in Kali Linux, but if you have a minimal build, then you may need to install the DBMS manually. If you try to install the <strong>mysql-server<\/strong> package, you will receive the following error:\n<\/p>\n<pre class=\"brush:plain;\" style=\"text-align: justify;\">\r\nPackage mysql-server is not available, but is referred to by another package.\r\nThis may mean that the package is missing, has been obsoleted, or\r\nis only available from another source\r\n\r\nE: Package &#39;mysql-server&#39; has no installation candidate<\/pre>\n<p style=\"text-align: justify;\">\n\t<a href=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/mysql-server.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5911\" height=\"300\" src=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/mysql-server.png\" width=\"862\" srcset=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/mysql-server.png 862w, https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/mysql-server-768x267.png 768w\" sizes=\"(max-width: 862px) 100vw, 862px\" \/><\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\tThe fact is that in Kali Linux (and apparently in fresh Debian, as well as in all its derivatives), this package is called differently:\n<\/p>\n<ul>\n<li style=\"text-align: justify;\">\n\t\t<strong>default-mysql-server<\/strong> (DBMS executables and system database setup)\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t<strong>default-mysql-server-core<\/strong> (only DBMS executables)\n\t<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\n\tTherefore, use the following command to install MySQL:\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nsudo apt install default-mysql-server<\/pre>\n<p style=\"text-align: justify;\">\n\t<a href=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/mariadb-server.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5921\" height=\"308\" src=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/mariadb-server.png\" width=\"1031\" srcset=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/mariadb-server.png 1031w, https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/mariadb-server-1000x299.png 1000w, https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/mariadb-server-768x229.png 768w\" sizes=\"(max-width: 1031px) 100vw, 1031px\" \/><\/a>\n<\/p>\n<h2 style=\"text-align: justify;\">\n\t<a id=\"4\" name=\"4\"><\/a>Kali Linux replaced MySQL with MariaDB<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\tWe say MySQL, but MySQL is completely absent from the Kali Linux repositories. Regardless of whether this DBMS was preinstalled on your system or you installed it manually, <strong>MariaDB<\/strong> is installed instead.\n<\/p>\n<p style=\"text-align: justify;\">\n\tYou can verify this yourself with the command:\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\napt show default-mysql-server<\/pre>\n<p style=\"text-align: justify;\">\n\t<a href=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/default-mysql-server.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5920\" height=\"512\" src=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/default-mysql-server.png\" width=\"694\" \/><\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\tAgain, MySQL is absent in the Kali Linux repositories, and if you need exactly MySQL, and not MariaDB, then you will have to decide this either by connecting an additional repository, or by manually installing the downloaded file.\n<\/p>\n<p style=\"text-align: justify;\">\n\tMariaDB is also a database management system. It is forked from MySQL. MariaDB&#39;s job is to perform all the functions of MySQL, but to be better. The service name, the name of the configuration files have not changed. Just out of habit, I will continue to say &ldquo;MySQL&rdquo; in this tutorial, but we will work exclusively with MariaDB.\n<\/p>\n<h2 style=\"text-align: justify;\">\n\t<a id=\"5\" name=\"5\"><\/a>Setting up MySQL on Kali Linux<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\tMySQL config files:\n<\/p>\n<ul>\n<li style=\"text-align: justify;\">\n\t\t\/etc\/mysql\/my.cnf (link to \/etc\/alternatives\/my.cnf)\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t\/etc\/mysql\/debian.cnf (obsolete file will be removed in future versions)\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t\/etc\/mysql\/conf.d\/mysql.cnf\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t\/etc\/mysql\/conf.d\/mysqldump.cnf\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t\/etc\/mysql\/mariadb.conf.d\/50-client.cnf\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t\/etc\/mysql\/mariadb.conf.d\/50-mysqld_safe.cnf\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t\/etc\/mysql\/mariadb.conf.d\/60-galera.cnf\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t\/etc\/mysql\/mariadb.conf.d\/50-mysql-clients.cnf\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t<strong>\/etc\/mysql\/mariadb.conf.d\/50-server.cnf<\/strong>\n\t<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\n\tMost of the settings are collected in the <strong>50-server.cnf<\/strong> file. By default, the MySQL service listens for incoming connections only on localhost (connections from other computers are not possible).\n<\/p>\n<h2 style=\"text-align: justify;\">\n\t<a id=\"6\" name=\"6\"><\/a>Starting and enabling MySQL autorun<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\tTo start the service, run the command:\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nsudo systemctl start mysql<\/pre>\n<p style=\"text-align: justify;\">\n\tBy default, all network services are disabled from autostart, see the article &ldquo;<a href=\"https:\/\/miloserdov.org\/?p=5898\" rel=\"noopener noreferrer\" target=\"_blank\">Configuring and starting network services on Kali Linux (Apache, MySQL, SSH, PostgreSQL, NetworkManager and Bluetooth)<\/a>&rdquo; for details.\n<\/p>\n<p style=\"text-align: justify;\">\n\tTo enable MySQL autorun every time you turn on your computer, run the command:\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nsudo systemctl enable mysql<\/pre>\n<h2 style=\"text-align: justify;\">\n\t<a id=\"7\" name=\"7\"><\/a>Setting and changing the MySQL password. Reset forgotten MySQL\/MariaDB password<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\tFor a newly installed MySQL, the root password is empty. To change it, run and follow the instructions:\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nsudo mysql_secure_installation<\/pre>\n<p style=\"text-align: justify;\">\n\tFor a detailed description of the steps and translation of instructions, see the article &ldquo;<a href=\"https:\/\/miloserdov.org\/?p=5873\" rel=\"noopener noreferrer\" target=\"_blank\">What is the MySQL root password in Kali Linux. How to change\/reset MySQL root password in Kali Linux<\/a>&rdquo;. In the same article, see how to reset your password if you&#39;ve forgotten it.\n<\/p>\n<h2 style=\"text-align: justify;\">\n\t<a id=\"8\" name=\"8\"><\/a>How to connect to MySQL server<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\tWhen the MySQL server service is running, you need to use a command like this to connect to it:\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nmysql -u USER -p -h HOST<\/pre>\n<p style=\"text-align: justify;\">\n\tAll three arguments are optional.\n<\/p>\n<p style=\"text-align: justify;\">\n\tIf the <strong>-u<\/strong> option is omitted, the current OS username will be used as the MySQL username.\n<\/p>\n<p style=\"text-align: justify;\">\n\tThe <strong>-p<\/strong> option means that you are logged in with a password. After this option, you do not need to write a password &#8211; it will be requested at the command line prompt.\n<\/p>\n<p style=\"text-align: justify;\">\n\tIf you do not specify the <strong>-h<\/strong> option, then an attempt will be made to connect to the local server.\n<\/p>\n<p style=\"text-align: justify;\">\n\tAttempting to connect when no user password is set:\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nmysql -u root<\/pre>\n<p style=\"text-align: justify;\">\n\tThis will throw an error:\n<\/p>\n<pre class=\"brush:plain;\" style=\"text-align: justify;\">\r\nERROR 1698 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39;<\/pre>\n<p style=\"text-align: justify;\">\n\tThe essence of the problem is that unix_socket authentication is used by default, that is, when the OS username coincides with the username in MySQL\/MariaDB, then the password does not need to be entered at all. But other users cannot log in as another user, so you need to use <strong>sudo<\/strong> to log in as root. See the article &ldquo;<a href=\"https:\/\/suay.site\/?p=606\" rel=\"noopener noreferrer\" target=\"_blank\">Password and unix_socket authentication in MySQL and MariaDB<\/a>&rdquo; for details.\n<\/p>\n<p style=\"text-align: justify;\">\n\tYou can choose one of the options:\n<\/p>\n<p style=\"text-align: justify;\">\n\t1. Always use <strong>sudo<\/strong>:\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nmysql -u root<\/pre>\n<p style=\"text-align: justify;\">\n\t2. Make changes to the MySQL settings so that ordinary users can connect to the DBMS.\n<\/p>\n<p style=\"text-align: justify;\">\n\t3. Create a new MySQL user. If this is a user with the same name as your name in the OS, then you can use unix_socket authentication and not enter a password when connecting. Alternatively, you can choose password authentication and use any name.\n<\/p>\n<p style=\"text-align: justify;\">\n\tTo access the MariaDB database as a regular user without using sudo privileges (this will also set the root user password), go to the MySQL command line prompt\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nsudo mysql<\/pre>\n<p style=\"text-align: justify;\">\n\tand run the following SQL commands:\n<\/p>\n<pre class=\"brush:sql;\" style=\"text-align: justify;\">\r\nuse mysql;\r\nALTER USER &#39;root&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;PASSWORD&#39;;\r\nexit<\/pre>\n<p style=\"text-align: justify;\">\n\tPlease note that you need to enter the PASSWORD.\n<\/p>\n<p style=\"text-align: justify;\">\n\tThen try logging into the database without <strong>sudo<\/strong> as shown below.\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nmysql -u root -p<\/pre>\n<h2 style=\"text-align: justify;\">\n\t<a id=\"9\" name=\"9\"><\/a>How to change MySQL user password in Kali Linux<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\tThe method shown above was used to change the authentication types, but it can also be used to change the password.\n<\/p>\n<p style=\"text-align: justify;\">\n\tGo to the MySQL command line prompt (use either <strong>sudo<\/strong> or the <strong>-u<\/strong> option to log in as root):\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nmysql -u root -p<\/pre>\n<p style=\"text-align: justify;\">\n\tand run the following commands:\n<\/p>\n<pre class=\"brush:sql;\" style=\"text-align: justify;\">\r\nuse mysql;\r\nALTER USER &#39;root&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;NEW PASSWORD&#39;;\r\nexit<\/pre>\n<p style=\"text-align: justify;\">\n\tPlease note that you need to enter a NEW PASSWORD.\n<\/p>\n<p style=\"text-align: justify;\">\n\tAlso note that this method changes the root user&#39;s password. If you want to change the password of another MySQL user, then in the previous SQL query specify the name of this user, for example:\n<\/p>\n<pre class=\"brush:sql;\" style=\"text-align: justify;\">\r\nALTER USER &#39;USER&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;NEW PASSWORD&#39;;<\/pre>\n<h2 style=\"text-align: justify;\">\n\t<a id=\"10\" name=\"10\"><\/a>No password and empty MySQL password<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\tIf you work exclusively on localhost and you do not care about security problems, then for convenience you can set an empty password (do not do this if you do not fully understand the possible risks):\n<\/p>\n<pre class=\"brush:sql;\" style=\"text-align: justify;\">\r\nALTER USER &#39;root&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;&#39;;<\/pre>\n<p style=\"text-align: justify;\">\n\tIn this case, when connecting, you do not need to use the <strong>-p<\/strong> option:\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nmysql -u root<\/pre>\n<h2 style=\"text-align: justify;\">\n\t<a id=\"11\" name=\"11\"><\/a>How to install phpMyAdmin on Kali Linux<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\tBy default phpMyAdmin is not installed on Kali Linux.\n<\/p>\n<p style=\"text-align: justify;\">\n\tInstallation can be done in two ways:\n<\/p>\n<ol>\n<li style=\"text-align: justify;\">\n\t\tSince phpMyAdmin is a PHP web application, you can simply download the archive with the source code (scripts) and unpack it to any folder on the server.\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\tMost distributions have a phpMyAdmin installation package in the standard repositories. The advantage of this approach is that you do not need to keep track of new phpMyAdmin releases and do manual updates.\n\t<\/li>\n<\/ol>\n<p style=\"text-align: justify;\">\n\tI prefer to install phpMyAdmin from the standard repositories (while WordPress, on the contrary, I prefer to install by simply copying the folder with the WordPress files to the web server folder; thanks to this I control the update process; if you really need to update, then all this is done in the convenient web interface of WordPress itself).\n<\/p>\n<p style=\"text-align: justify;\">\n\tYou should already have Apache, MySQL, PHP installed. By default, they are already available in Kali Linux, but if you have a version with a minimum number of packages, then install them:\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nsudo apt install apache2 default-mysql-server php<\/pre>\n<p style=\"text-align: justify;\">\n\tInstall phpMyAdmin with the following command:\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nsudo apt install phpmyadmin<\/pre>\n<p style=\"text-align: justify;\">\n\tAnswer No to the configuration prompt with <strong>dbconfig-common<\/strong>:\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/dbconfig-common-no.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5919\" height=\"262\" src=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/dbconfig-common-no.png\" width=\"1859\" srcset=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/dbconfig-common-no.png 1859w, https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/dbconfig-common-no-1000x141.png 1000w, https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/dbconfig-common-no-1500x211.png 1500w, https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/dbconfig-common-no-768x108.png 768w, https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/dbconfig-common-no-1536x216.png 1536w\" sizes=\"(max-width: 1859px) 100vw, 1859px\" \/><\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\tUse the <strong>Tab<\/strong> key to move between items and <strong>Enter<\/strong> to press.\n<\/p>\n<p style=\"text-align: justify;\">\n\tSelect &ldquo;<strong>apache2<\/strong>&rdquo;.\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/apache-phpmyadmin.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5918\" height=\"229\" src=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/apache-phpmyadmin.png\" width=\"713\" \/><\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\tUse the <strong>Space<\/strong> key to select items, use the <strong>Tab<\/strong> key to move between items, and press <strong>Enter<\/strong> to finish.\n<\/p>\n<p style=\"text-align: justify;\">\n\tNow, after enabling the web server, phpMyAdmin will be available at&nbsp;<strong>http:\/\/your_server_IP\/phpmyadmin\/<\/strong>\n<\/p>\n<p style=\"text-align: justify;\">\n\tAnd for a local server at <a href=\"http:\/\/localhost\/phpmyadmin\/\" rel=\"noopener noreferrer\" target=\"_blank\">http:\/\/localhost\/phpmyadmin\/<\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-kali-linux.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5917\" height=\"873\" src=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-kali-linux.png\" width=\"1184\" srcset=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-kali-linux.png 1184w, https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-kali-linux-1000x737.png 1000w, https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-kali-linux-768x566.png 768w\" sizes=\"(max-width: 1184px) 100vw, 1184px\" \/><\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\tDon&#39;t forget to start the services:\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nsudo systemctl start apache2\r\nsudo systemctl start mysql<\/pre>\n<p style=\"text-align: justify;\">\n\tAt the bottom of the phpMyAdmin page, you can see the messages with a red background:\n<\/p>\n<pre class=\"brush:plain;\" style=\"text-align: justify;\">\r\nThe phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. Find out why.\r\nOr alternately go to &#39;Operations&#39; tab of any database to set it up there.<\/pre>\n<p style=\"text-align: justify;\">\n\t<a href=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-extra-3.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5914\" height=\"154\" src=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-extra-3.png\" width=\"498\" \/><\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\tIf you only want to enable them, then follow the link <a href=\"http:\/\/localhost\/phpmyadmin\/chk_rel.php\" rel=\"noopener noreferrer\" target=\"_blank\">http:\/\/localhost\/phpmyadmin\/chk_rel.php<\/a> and click &ldquo;<strong>Create Database<\/strong>&rdquo;.\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-extra.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5913\" height=\"219\" src=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-extra.png\" width=\"724\" \/><\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\tAfter that, all new functions will be activated.\n<\/p>\n<p style=\"text-align: justify;\">\n\t<a href=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-extra-2.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5912\" height=\"731\" src=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-extra-2.png\" width=\"966\" srcset=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-extra-2.png 966w, https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-extra-2-768x581.png 768w\" sizes=\"(max-width: 966px) 100vw, 966px\" \/><\/a>\n<\/p>\n<h2 style=\"text-align: justify;\">\n\t<a id=\"12\" name=\"12\"><\/a>How to change phpMyAdmin URL.&nbsp;How to enable and disable phpMyAdmin<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\tIf during the installation of phpMyAdmin you chose not to configure it for use with the Apache web server, use the command to enable phpMyAdmin:\n<\/p>\n<pre class=\"brush:bash;\">\r\nsudo ln -s \/etc\/phpmyadmin\/apache.conf \/etc\/apache2\/conf-enabled\/<\/pre>\n<p style=\"text-align: justify;\">\n\tRestart the web server for the changes to take effect.\n<\/p>\n<p style=\"text-align: justify;\">\n\tTo disable phpMyAdmin use the command:\n<\/p>\n<pre class=\"brush:bash;\">\r\nsudo rm \/etc\/apache2\/conf-enabled\/phpmyadmin.conf<\/pre>\n<p style=\"text-align: justify;\">\n\tRestart the web server for the changes to take effect.\n<\/p>\n<p style=\"text-align: justify;\">\n\tThere is an important line in the <strong>\/etc\/phpmyadmin\/apache.conf<\/strong> file:\n<\/p>\n<pre class=\"brush:plain;\" style=\"text-align: justify;\">\r\nAlias \/phpmyadmin \/usr\/share\/phpmyadmin<\/pre>\n<p style=\"text-align: justify;\">\n\tIts essence is that the URL <strong>\/phpmyadmin<\/strong> (for example, <strong>http:\/\/localhost\/phpmyadmin<\/strong>) begins to correspond to the \/usr\/share\/phpmyadmin folder. That is, the phpMyAdmin files (scripts) are physically located in <strong>\/usr\/share\/phpmyadmin<\/strong>, and not in the web server directory (for example, <strong>\/var\/www\/html\/<\/strong>).\n<\/p>\n<p style=\"text-align: justify;\">\n\tMany automatic scanners of &ldquo;hidden&rdquo; files and folders of the web server and sites must check the directories &ldquo;<strong>phpmyadmin<\/strong>&rdquo;, &ldquo;<strong>pma<\/strong>&rdquo; and others like that. You can hide your phpMyAdmin nicely by changing the <strong>Alias<\/strong>. For instance:\n<\/p>\n<pre class=\"brush:plain;\" style=\"text-align: justify;\">\r\nAlias \/lkjgler94345 \/usr\/share\/phpmyadmin<\/pre>\n<p style=\"text-align: justify;\">\n\tPhpMyAdmin will now be available at <strong>http:\/\/localhost\/lkjgler94345<\/strong> &#8211; not easy to find.\n<\/p>\n<h2 style=\"text-align: justify;\">\n\t<a id=\"13\" name=\"13\"><\/a>Error &ldquo;Login without a password is forbidden by configuration (see AllowNoPassword)&rdquo;<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\tWhen you try to log into phpMyAdmin with a blank password, you may receive an error:\n<\/p>\n<pre class=\"brush:plain;\" style=\"text-align: justify;\">\r\nLogin without a password is forbidden by configuration (see AllowNoPassword)<\/pre>\n<p style=\"text-align: justify;\">\n\t<a href=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-error.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5916\" height=\"546\" src=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-error.png\" width=\"561\" \/><\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\tThe bottom line is that login as root or another user without a password is prohibited by the phpMyAdmin configuration.\n<\/p>\n<p style=\"text-align: justify;\">\n\tTwo ways to fix it:\n<\/p>\n<ul>\n<li style=\"text-align: justify;\">\n\t\tset MySQL password\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\tallow passwordless login in phpMyAdmin config\n\t<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\n\tTo enable passwordless login in phpMyAdmin, open the <strong>\/etc\/phpmyadmin\/config.inc.php<\/strong> file:\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nsudo gedit \/etc\/phpmyadmin\/config.inc.php<\/pre>\n<p style=\"text-align: justify;\">\n\tFind the second (there are two) line:\n<\/p>\n<pre class=\"brush:php;\" style=\"text-align: justify;\">\r\n\/\/ $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;<\/pre>\n<p style=\"text-align: justify;\">\n\tuncomment it to get:\n<\/p>\n<pre class=\"brush:php;\" style=\"text-align: justify;\">\r\n$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;<\/pre>\n<p style=\"text-align: justify;\">\n\t<a href=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-config.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" class=\"alignnone size-full wp-image-5915\" height=\"347\" src=\"https:\/\/miloserdov.org\/wp-content\/uploads\/2021\/03\/phpmyadmin-config.png\" width=\"697\" \/><\/a>\n<\/p>\n<p style=\"text-align: justify;\">\n\tSave and close the <strong>config.inc.php<\/strong> file.\n<\/p>\n<h2 style=\"text-align: justify;\">\n\t<a id=\"14\" name=\"14\"><\/a>How to use phpMyAdmin on Kali Linux<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\tWorking in phpMyAdmin is intuitive, so there shouldn&#39;t be any difficulties.\n<\/p>\n<p style=\"text-align: justify;\">\n\tBut by default PHP has very small limits on the size of the processed file, so if you import or export a large database, you may encounter phpMyAdmin&#39;s &ldquo;<strong>Incorrect format parameter<\/strong>&rdquo;. The error occurs due to PHP restrictions on the size of uploaded files and files transferred by the POST method.\n<\/p>\n<p style=\"text-align: justify;\">\n\tIt is necessary to increase the value of these two variables in the <strong>php.ini<\/strong>&nbsp;(to find it <strong>locate php.ini<\/strong>) configuration file. Open the php.ini file and set a larger value for the following variables:\n<\/p>\n<pre class=\"brush:plain;\" style=\"text-align: justify;\">\r\nupload_max_filesize=64M\r\npost_max_size=64M<\/pre>\n<p style=\"text-align: justify;\">\n\tBy default, the values there are:\n<\/p>\n<pre class=\"brush:plain;\" style=\"text-align: justify;\">\r\nupload_max_filesize = 2M\r\npost_max_size = 8M<\/pre>\n<p style=\"text-align: justify;\">\n\tOf course, this is too little for almost any task.\n<\/p>\n<p style=\"text-align: justify;\">\n\tRestart the web server for the changes to take effect.\n<\/p>\n<p style=\"text-align: justify;\">\n\tIf you work a lot with phpMyAdmin, then you can customize it for yourself, including setting default settings for import and export. An example of how to do this in the article &ldquo;<a href=\"https:\/\/suay.site\/?p=643\" rel=\"noopener noreferrer\" target=\"_blank\">How to change default export settings in phpMyAdmin<\/a>&rdquo;.\n<\/p>\n<h2 style=\"text-align: justify;\">\n\t<a id=\"15\" name=\"15\"><\/a>phpMyAdmin alternative<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\tNote that phpMyAdmin is a shim that uses PHP to manipulate databases. Therefore, there is a loss in speed when processing very large databases, and you can also encounter the PHP limits set in its configuration file.\n<\/p>\n<p style=\"text-align: justify;\">\n\tImporting and exporting large databases into MySQL can be performed using MySQL itself &#8211; auxiliary utilities are supplied with the DBMS that allow you to perform various actions. To export databases, you can use mysqldump utility.\n<\/p>\n<p style=\"text-align: justify;\">\n\tTo <strong>export a database<\/strong>, use&nbsp;the following command\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nmysqldump -u username -p database_name &gt; data-dump.sql<\/pre>\n<p style=\"text-align: justify;\">\n\tWhere:\n<\/p>\n<ul>\n<li style=\"text-align: justify;\">\n\t\t<strong>username<\/strong> is the username with which you can log into the database\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t<strong>database_name<\/strong> is the name of the database to export\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t<strong>data-dump.sql<\/strong> is a file in the current directory where the output will be saved\n\t<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\n\t<strong>Database import<\/strong>\n<\/p>\n<p style=\"text-align: justify;\">\n\tTo import an existing database file into MySQL or MariaDB, you need to create a new database into which the contents of the dump file will be imported.\n<\/p>\n<p style=\"text-align: justify;\">\n\tStart by logging into the database as root or another user with sufficient privileges to create a new database.\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nmysql -u root -p<\/pre>\n<p style=\"text-align: justify;\">\n\tThis will give you a prompt to the MySQL shell. Next, create a new database called new_database.\n<\/p>\n<pre class=\"brush:sql;\" style=\"text-align: justify;\">\r\nCREATE DATABASE new_database;<\/pre>\n<p style=\"text-align: justify;\">\n\tA confirmation will be displayed about creation.\n<\/p>\n<pre class=\"brush:plain;\" style=\"text-align: justify;\">\r\nOutput\r\nQuery OK, 1 row affected (0.00 sec)<\/pre>\n<p style=\"text-align: justify;\">\n\tNow exit the MySQL shell by pressing <strong>CTRL+D<\/strong>. On a regular command line, you can import the file with the following command:\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nmysql -u username -p new_database &lt; data-dump.sql<\/pre>\n<p style=\"text-align: justify;\">\n\tWhere:\n<\/p>\n<ul>\n<li style=\"text-align: justify;\">\n\t\t<strong>username<\/strong> is the username with which you can log into the database\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t<strong>newdatabase<\/strong> is the name of the newly created database\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t<strong>data-dump.sql <\/strong>&#8211; dump file with data for import located in the current directory\n\t<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\n\tSuccessful execution of the command will not display any messages. If errors occur during this process, mysql will print them in the terminal. You can verify that the database has been imported by logging into the MySQL shell again and analyzing the data. This can be done by selecting a new database with the command\n<\/p>\n<pre class=\"brush:sql;\" style=\"text-align: justify;\">\r\nUSE new_database<\/pre>\n<p style=\"text-align: justify;\">\n\tand then send a SQL query:\n<\/p>\n<pre class=\"brush:sql;\" style=\"text-align: justify;\">\r\nSHOW TABLES;<\/pre>\n<p style=\"text-align: justify;\">\n\tor a similar command to view the data.\n<\/p>\n<p style=\"text-align: justify;\">\n\t<strong>How do I backup multiple MySQL databases?<\/strong>\n<\/p>\n<p style=\"text-align: justify;\">\n\tIf you want to back up multiple databases, run the following command. The following example will backup the structure and data of the rsyslog, syslog databases into a single file called rsyslog_syslog.sql.\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nmysqldump -u root -p --databases rsyslog syslog &gt; rsyslog_syslog.sql<\/pre>\n<p style=\"text-align: justify;\">\n\tHow do I back up all databases?\n<\/p>\n<p style=\"text-align: justify;\">\n\tIf you want to back up all databases, then use the following command with the &#8211;all-database option. The following command will back up all databases, their structure and information, to a file called all-databases.sql.\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nmysqldump -u root -ptecmint --all-databases &gt; all-databases.sql<\/pre>\n<p style=\"text-align: justify;\">\n\t<strong>How to backup only the MySQL database structure?<\/strong>\n<\/p>\n<p style=\"text-align: justify;\">\n\tIf you want to make a backup copy of the database structure without information, then use the &#8211;no-data option in the command. The following command will export the rsyslog database structure to the rsyslog_structure.sql file.\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nmysqldump -u root -p --no-data rsyslog &gt; rsyslog_structure.sql<\/pre>\n<p style=\"text-align: justify;\">\n\t<strong>How to backup only information from MySQL database?<\/strong>\n<\/p>\n<p style=\"text-align: justify;\">\n\tTo create a backup of only information from a database without a structure, use the &#8211;no-create-info option with the command. This command will take data from the rsyslog database and copy it to the rsyslog_data.sql file.\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nmysqldump -u root -p --no-create-db --no-create-info rsyslog &gt; rsyslog_data.sql<\/pre>\n<p style=\"text-align: justify;\">\n\t<strong>How do I backup one table from a database?<\/strong>\n<\/p>\n<p style=\"text-align: justify;\">\n\tWith the next command you can make a backup copy of one table or certain tables from your database. For example, the following command will only make a backup of the wp_posts table from the wordpress database.\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nmysqldump -u root -p wordpress wp_posts &gt; wordpress_posts.sql<\/pre>\n<p style=\"text-align: justify;\">\n\t<strong>How do I backup multiple tables?<\/strong>\n<\/p>\n<p style=\"text-align: justify;\">\n\tIf you want to back up several or specific tables from the database, separate each table with a space.\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nmysqldump -u root -p wordpress wp_posts wp_comments &gt; wordpress_posts_comments.sql<\/pre>\n<p style=\"text-align: justify;\">\n\t<strong>How do I back up a remote MySQL database?<\/strong>\n<\/p>\n<p style=\"text-align: justify;\">\n\tThe following command will back up the &ldquo;gallery&rdquo; database from the remote server 185.117.153.79 to the local server.\n<\/p>\n<pre class=\"brush:bash;\" style=\"text-align: justify;\">\r\nmysqldump -h 185.117.153.79 -u root -p gallery &gt; gallery.sql<\/pre>\n<p style=\"text-align: justify;\">\n\tYou can edit databases, add new records, delete records, etc. from the command line using SQL queries.\n<\/p>\n<h2 style=\"text-align: justify;\">\n\t<a id=\"16\" name=\"16\"><\/a>Additional MySQL Resources<br \/>\n<\/h2>\n<p style=\"text-align: justify;\">\n\tYou may also be interested in the following articles:\n<\/p>\n<ul>\n<li style=\"text-align: justify;\">\n\t\t<a href=\"https:\/\/miloserdov.org\/?p=5898\" rel=\"noopener noreferrer\" target=\"_blank\">Configuring and starting network services on Kali Linux (Apache, MySQL, SSH, PostgreSQL, NetworkManager and Bluetooth)<\/a>\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t<a href=\"https:\/\/miloserdov.org\/?p=5883\" rel=\"noopener noreferrer\" target=\"_blank\">Basics of working with a web server for a pentester<\/a>\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t<a href=\"https:\/\/miloserdov.org\/?p=5873\" rel=\"noopener noreferrer\" target=\"_blank\">What is the MySQL root password in Kali Linux. How to change\/reset MySQL root password in Kali Linux<\/a>\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t<a href=\"https:\/\/miloserdov.org\/?p=4747\" rel=\"noopener noreferrer\" target=\"_blank\">Default passwords in Kali Linux<\/a>\n\t<\/li>\n<li style=\"text-align: justify;\">\n\t\t<a href=\"https:\/\/suay.site\/?p=606\" rel=\"noopener noreferrer\" target=\"_blank\">Password and unix_socket authentication in MySQL and MariaDB. Error &ldquo;#1698 &#8211; Access denied for user &lsquo;root&rsquo;@&rsquo;localhost&rsquo;&rdquo; (SOLVED)<\/a>\n\t<\/li>\n<\/ul>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Table of contents 1. What is MySQL for 2. MySQL client and server 3. Installing MySQL on Kali Linux 4.&nbsp;Kali Linux replaced MySQL with MariaDB 5.&nbsp;Setting up MySQL on Kali Linux 6.&nbsp;Starting and enabling MySQL autorun 7.&nbsp;Setting and changing the MySQL password. Reset forgotten MySQL\/MariaDB password 8.&nbsp;How to connect to<a href=\"https:\/\/miloserdov.org\/?p=5910\" class=\"read-more\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":5917,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[25,163,23,684,24,20],"class_list":["post-5910","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-work-environment","tag-kali-linux","tag-mariadb","tag-mysql","tag-mysqldump","tag-phpmyadmin","tag-web-server"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/miloserdov.org\/index.php?rest_route=\/wp\/v2\/posts\/5910"}],"collection":[{"href":"https:\/\/miloserdov.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/miloserdov.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/miloserdov.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/miloserdov.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5910"}],"version-history":[{"count":7,"href":"https:\/\/miloserdov.org\/index.php?rest_route=\/wp\/v2\/posts\/5910\/revisions"}],"predecessor-version":[{"id":5939,"href":"https:\/\/miloserdov.org\/index.php?rest_route=\/wp\/v2\/posts\/5910\/revisions\/5939"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/miloserdov.org\/index.php?rest_route=\/wp\/v2\/media\/5917"}],"wp:attachment":[{"href":"https:\/\/miloserdov.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5910"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/miloserdov.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5910"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/miloserdov.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5910"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}