Phpmyadmin какой логин и пароль

от admin

WAMP phpMyAdmin username and password.

This is something that caught me off-guard a while back, so I figured that I would write a quick post about it. Hopefully, I can save you some time and confusion!

A couple of years ago, I installed WAMP via a handy installer that did all of the work for me. This installer automatically created Apache, MySQL, PHP and phpMyAdmin on my Windows PC. i.e. I didn’t have to mess around with configuration files or Apache modules and I didn’t have to manually install phpMyAdmin!

As you probably already know, phpMyAdmin is a web-based administration tool for MySQL. It gives you a GUI interface that allows you to create MySQL databases and table structures. When you automatically install WAMP on a Windows PC, phpMyAdmin is usually located at http://localhost/phpmyadmin

Unfortunately for me, I could not login to phpMyAdmin as I did not know what the MySQL username and password was! During the installation process, I was not asked to create a user account. In fact, the only thing that I was asked was which installation path I wanted to use.

Default phpMyAdmin username and password.

If you’re having trouble logging into a fresh install of phpMyAdmin, then simply use the following username and password:

  • user: root
  • password: *blank*

The above login credentials belong to the default MySQL user account that gets created during a new install. Note that you should leave the password field completely blank. Do not actually type in *blank*.

How To Install and Secure phpMyAdmin on Ubuntu 20.04

While many users need the functionality of a database management system like MySQL, they may not feel comfortable interacting with the system solely from the MySQL prompt.

phpMyAdmin was created so that users can interact with MySQL through a web interface. In this guide, we’ll discuss how to install and secure phpMyAdmin so that you can safely use it to manage your databases on an Ubuntu 20.04 system.

Prerequisites

In order to complete this guide, you will need:

  • An Ubuntu 20.04 server. This server should have a non-root user with administrative privileges and a firewall configured with ufw . To set this up, follow our initial server setup guide for Ubuntu 20.04.
  • A LAMP (Linux, Apache, MySQL, and PHP) stack installed on your Ubuntu 20.04 server. If this is not completed yet, you can follow this guide on installing a LAMP stack on Ubuntu 20.04.

Additionally, there are important security considerations when using software like phpMyAdmin, since it:

  • Communicates directly with your MySQL installation
  • Handles authentication using MySQL credentials
  • Executes and returns results for arbitrary SQL queries

For these reasons, and because it is a widely-deployed PHP application which is frequently targeted for attack, you should never run phpMyAdmin on remote systems over a plain HTTP connection.

If you do not have an existing domain configured with an SSL/TLS certificate, you can follow this guide on securing Apache with Let’s Encrypt on Ubuntu 20.04. This will require you to register a domain name, create DNS records for your server, and set up an Apache Virtual Host.

Step 1 — Installing phpMyAdmin

You can use APT to install phpMyAdmin from the default Ubuntu repositories.

As your non-root sudo user, update your server’s package index:

Following that you can install the phpmyadmin package. Along with this package, the official documentation also recommends that you install a few PHP extensions onto your server to enable certain functionalities and improve performance.

If you followed the prerequisite LAMP stack tutorial, several of these modules will have been installed along with the php package. However, it’s recommended that you also install these packages:

  • php-mbstring : A module for managing non-ASCII strings and convert strings to different encodings
  • php-zip : This extension supports uploading .zip files to phpMyAdmin
  • php-gd : Enables support for the GD Graphics Library
  • php-json : Provides PHP with support for JSON serialization
  • php-curl : Allows PHP to interact with different kinds of servers using different protocols

Be aware that if you’re using a version of PHP other than the default one installed in the prerequisite LAMP stack tutorial, you will need to install the appropriate versions of these module packages. For instance, if you’re using PHP version 8.0 , you will need to install the php8.0-mbstring package instead of the default php-mbstring package.

Run the following command to install these packages onto your system. Please note, though, that the installation process requires you to make some choices to configure phpMyAdmin correctly. We’ll walk through these options shortly:

Here are the options you should choose when prompted in order to configure your installation correctly:

  • For the server selection, choose apache2

Warning: When the prompt appears, “apache2” is highlighted, but not selected. If you do not hit SPACE to select Apache, the installer will not move the necessary files during installation. Hit SPACE , TAB , and then ENTER to select Apache.

  • Select Yes when asked whether to use dbconfig-common to set up the database
  • You will then be asked to choose and confirm a MySQL application password for phpMyAdmin

Note: Assuming you installed MySQL by following Step 2 of the prerequisite LAMP stack tutorial, you may have decided to enable the Validate Password plugin. As of this writing, enabling this component will trigger an error when you attempt to set a password for the phpmyadmin user:

phpMyAdmin password validation error

To resolve this, select the abort option to stop the installation process. Then, open up your MySQL prompt:

Or, if you enabled password authentication for the root MySQL user, run this command and then enter your password when prompted:

From the prompt, run the following command to disable the Validate Password component. Note that this won’t actually uninstall it, but just stop the component from being loaded on your MySQL server:

Following that, you can close the MySQL client:

Then try installing the phpmyadmin package again and it will work as expected:

Once phpMyAdmin is installed, you can open the MySQL prompt once again with sudo mysql or mysql -u root -p and then run the following command to re-enable the Validate Password component:

The installation process adds the phpMyAdmin Apache configuration file into the /etc/apache2/conf-enabled/ directory, where it is read automatically. To finish configuring Apache and PHP to work with phpMyAdmin, the only remaining task in this section of the tutorial is to is explicitly enable the mbstring PHP extension, which you can do by typing:

Afterwards, restart Apache for your changes to be recognized:

phpMyAdmin is now installed and configured to work with Apache. However, before you can log in and begin interacting with your MySQL databases, you will need to ensure that your MySQL users have the privileges required for interacting with the program.

Step 2 — Adjusting User Authentication and Privileges

When you installed phpMyAdmin onto your server, it automatically created a database user called phpmyadmin which performs certain underlying processes for the program. Rather than logging in as this user with the administrative password you set during installation, it’s recommended that you log in as either your root MySQL user or as a user dedicated to managing databases through the phpMyAdmin interface.

Configuring Password Access for the MySQL Root Account

In Ubuntu systems running MySQL 5.7 (and later versions), the root MySQL user is set to authenticate using the auth_socket plugin by default rather than with a password. This allows for some greater security and usability in many cases, but it can also complicate things when you need to allow an external program — like phpMyAdmin — to access the user.

In order to log in to phpMyAdmin as your root MySQL user, you will need to switch its authentication method from auth_socket to one that makes use of a password, if you haven’t already done so. To do this, open up the MySQL prompt from your terminal:

Next, check which authentication method each of your MySQL user accounts use with the following command:

In this example, you can see that the root user does in fact authenticate using the auth_socket plugin. To configure the root account to authenticate with a password, run the following ALTER USER command. Be sure to change password to a strong password of your choosing:

Note: The previous ALTER USER statement sets the root MySQL user to authenticate with the caching_sha2_password plugin. Per the official MySQL documentation, caching_sha2_password is MySQL’s preferred authentication plugin, as it provides more secure password encryption than the older, but still widely used, mysql_native_password .

However, some versions of PHP don’t work reliably with caching_sha2_password . PHP has reported that this issue was fixed as of PHP 7.4, but if you encounter an error when trying to log in to phpMyAdmin later on, you may want to set root to authenticate with mysql_native_password instead:

Then, check the authentication methods employed by each of your users again to confirm that root no longer authenticates using the auth_socket plugin:

You can see from this output that the root user will authenticate using a password. You can now log in to the phpMyAdmin interface as your root user with the password you’ve set for it here.

Configuring Password Access for a Dedicated MySQL User

Alternatively, some may find that it better suits their workflow to connect to phpMyAdmin with a dedicated user. To do this, open up the MySQL shell once again:

If you have password authentication enabled for your root user, as described in the previous section, you will need to run the following command and enter your password when prompted in order to connect:

From there, create a new user and give it a strong password:

Note: Again, depending on what version of PHP you have installed, you may want to set your new user to authenticate with mysql_native_password instead of caching_sha2_password :

Then, grant your new user appropriate privileges. For example, you could grant the user privileges to all tables within the database, as well as the power to add, change, and remove user privileges, with this command:

Following that, exit the MySQL shell:

You can now access the web interface by visiting your server’s domain name or public IP address followed by /phpmyadmin :

phpMyAdmin login screen

Log in to the interface, either as root or with the new username and password you just configured.

When you log in, you’ll see the user interface, which will look something like this:

phpMyAdmin user interface

Now that you’re able to connect and interact with phpMyAdmin, all that’s left to do is harden your system’s security to protect it from attackers.

Step 3 — Securing Your phpMyAdmin Instance

Because of its ubiquity, phpMyAdmin is a popular target for attackers, and you should take extra care to prevent unauthorized access. One way of doing this is to place a gateway in front of the entire application by using Apache’s built-in .htaccess authentication and authorization functionalities.

To do this, you must first enable the use of .htaccess file overrides by editing your phpMyAdmin installation’s Apache configuration file.

Use your preferred text editor to edit the phpmyadmin.conf file that has been placed in your Apache configuration directory. Here, we’ll use nano :

Add an AllowOverride All directive within the <Directory /usr/share/phpmyadmin> section of the configuration file, like this:

When you have added this line, save and close the file. If you used nano to edit the file, do so by pressing CTRL + X , Y , and then ENTER .

Читать:
Как запустить технологический журнал 1с

To implement the changes you made, restart Apache:

Now that you have enabled the use of .htaccess files for your application, you need to create one to actually implement some security.

In order for this to be successful, the file must be created within the application directory. You can create the necessary file and open it in your text editor with root privileges by typing:

Within this file, enter the following information:

Here is what each of these lines mean:

  • AuthType Basic : This line specifies the authentication type that you are implementing. This type will implement password authentication using a password file.
  • AuthName : This sets the message for the authentication dialog box. You should keep this generic so that unauthorized users won’t gain any information about what is being protected.
  • AuthUserFile : This sets the location of the password file that will be used for authentication. This should be outside of the directories that are being served. We will create this file shortly.
  • Require valid-user : This specifies that only authenticated users should be given access to this resource. This is what actually stops unauthorized users from entering.

When you are finished, save and close the file.

The location that you selected for your password file was /etc/phpmyadmin/.htpasswd . You can now create this file and pass it an initial user with the htpasswd utility:

You will be prompted to select and confirm a password for the user you are creating. Afterwards, the file is created with the hashed password that you entered.

If you want to enter an additional user, you need to do so without the -c flag, like this:

Then restart Apache to put .htaccess authentication into effect:

Now, when you access your phpMyAdmin subdirectory, you will be prompted for the additional account name and password that you just configured:

phpMyAdmin apache password

After entering the Apache authentication, you’ll be taken to the regular phpMyAdmin authentication page to enter your MySQL credentials. By adding an extra set of non-MySQL credentials, you’re providing your database with an additional layer of security. This is desirable, since phpMyAdmin has been vulnerable to security threats in the past.

Conclusion

You should now have phpMyAdmin configured and ready to use on your Ubuntu 20.04 server. Using this interface, you can create databases, users, and tables, as well as perform the usual operations like deleting and modifying structures and data.

Get Ubuntu on a hosted virtual machine in seconds with DigitalOcean Droplets! Simple enough for any user, powerful enough for fast-growing applications or businesses.

PHPMyAdmin Default login password [closed]

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 10 years ago .

The community reviewed whether to reopen this question 7 months ago and left it closed:

Not suitable for this site This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.

I have done a fresh installation of Fedora 14 and installed the phpMyAdmin module. When I run phpMyAdmin, it asks me for a username and password.

Первый вход в phpmyadmin после установки.

Здравствуйте уважаемые гуру!
Я делаю первые шаги в освоении php и для этого установил на локальном компьютере комплект программ на базе сервера Apache.
Все как бы нормально и работает.

Но при первом входе в phpmyadmin через файл index.php система запрашивает логин и пароль.

Я их ранее не вводил и не знаю в каком именно месте это следует сделать. Только пожалуйста не говорите — читай хелп. Для меня в нем пока слишком много незнакомой информации. Я делал попытки и не нашел точного однозначного ответа.
Подскажите пожалуйста, что следует сделать. Буду очень признателен.

2 Ответ от Lokki 2006-07-15 16:34:48

  • Откуда: Москва
  • Зарегистрирован: 2006-01-25
  • Сообщений: 910
Re: Первый вход в phpmyadmin после установки.

Виктор

Я их ранее не вводил и не знаю в каком именно месте это следует сделать. Только пожалуйста не говорите — читай хелп. Для меня в нем пока слишком много незнакомой информации. Я делал попытки и не нашел точного однозначного ответа.
Подскажите пожалуйста, что следует сделать.

Для администрирования баз данных с помощью phpMyAdmin необходимо прежде подключиться к MySQL-серверу, для этого необходимо указать логин и пароль.

В случае с http- и cookie-аутентификацией это необходимо делать вручную, если же используется config-аутентификация — логин и пароль берется автоматически из конфигурационного файла, но использование данного метода крайне нежелательно с точки зрения безопасности.

3 Ответ от Виктор 2006-07-15 17:15:29

  • Зарегистрирован: 2006-07-15
  • Сообщений: 4
Re: Первый вход в phpmyadmin после установки.

Здравствуйте Lokki. Спасибо что откликнулись. Меня в данном случае интересует не безопасность- а скорее точка входа в процедуру.-) Все на локальном компьютере. SQL как бы сам по себе и как бы работает, Apache работает, PHP работает. Но пощупать саму базу данных, попытаться создать ее и вообще как то связать процесс можно, насколько я понимаю с помощью инструмента phpMyAdmin. Так вот я выполнил инсталяцию — но где мне указать пароль и логин? Вот в чем вопрос. Где именно. В каком собственно файле и что следует прописать?

Для администрирования баз данных с помощью phpMyAdmin необходимо прежде подключиться к MySQL-серверу, для этого необходимо указать логин и пароль

Я это и сам понимаю что без пароля не обойтись — но где его вписать — он автоматичиски может и берется откуда то. Но меня то просят его ввести вручную, а я его не знаю.-)

4 Ответ от Lokki 2006-07-15 18:03:32

  • Откуда: Москва
  • Зарегистрирован: 2006-01-25
  • Сообщений: 910
Re: Первый вход в phpmyadmin после установки.

Виктор
MySQL-сервер запускаете? При установке MySQL-сервера какие указывали логин и пароль для пользователя root? Если Вы не знаете логина и пароля для соединения с MySQL-сервером, то администрировать базы данных не получится.

В качестве логина можете использовать root, а вот какой пароль Вы задали для него я увы не знаю wink

5 Ответ от Виктор 2006-07-15 20:54:25 (изменено: Виктор, 2006-07-15 20:55:36)

  • Зарегистрирован: 2006-07-15
  • Сообщений: 4
Re: Первый вход в phpmyadmin после установки.

Lokki. Извините за назойливость или навязчивость — но получается такая штука. Я устанавливаю пакетное приложение appserv-win32-2.5.6.exe — в которое включены Apache.MySQL. PHP. PhpMyAdmin. В процессе установки меня запрашивают хост — я пишу localhost, эл. адрес пишу root@localhost. Это к Апачу. А далее экран MySql просят ввести Root пароль и повторить его. Я пишу в обоих полях root . Вся установка ( как и демонтаж) занимает 1 минуту. И сразу же все работает и Apach и MySql. Но попытка зайти с введенным мною паролем через phpmyadmin ни чем не кончается. Т.е. вообще ни чем — и меня ни кто в процессе установки не спрашивал имя или логин. Т.е я как Вы и советовали вводил root и Root и ROOT и иные комбинации в качестве логина — ну и пароль вписываю как бы тот который указал. Его и забыть то нельзя -)
Но не выходит ничего. Т.е. не признаются мои пароли и все. Что я делаю не так? Будьте добры — подскажите. Вот уже сутки не могу пробить эту защиту от самого себя-)

6 Ответ от Hanut 2006-07-15 22:14:34

  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,724
Re: Первый вход в phpmyadmin после установки.

Не очень понял проблему, но воозможно есть смысл воспользоваться Денвером http://www.denwer.ru/.
Гадаю: возможно проблемы с кукисами, поэтому пароль не проходит.
Попробуйте использовать конфигурационную установку. В файле config.inc.php сделайте следующие изменения:
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['auth_type'] = 'config'; // Вот это не пропустите.
$cfg['Servers'][$i]['user'] = 'root'; // Имя пользователя MySQL.
$cfg['Servers'][$i]['password'] = ''; // Здесь надо вписать ваш пароль к MySQL.

7 Ответ от irina 2008-08-23 22:06:17

  • Зарегистрирован: 2008-08-23
  • Сообщений: 1
Re: Первый вход в phpmyadmin после установки.

Доброй ночи, Модератор! После того, как промучилась три часа над решением проблемы (для меня — проблемы), даже не пожалела времени на регистрацию, чтобы сказать вам спасибо. Помогло. Очередной этап мучений пройден с вашей помощью. Ура.

8 Ответ от Paul 2015-02-09 06:42:13

  • Зарегистрирован: 2015-02-09
  • Сообщений: 1
Re: Первый вход в phpmyadmin после установки.

Боже мой, ув. Админ Вам задали безобиднейший вопрос! neutral
Логин: `root`
Пароль: «

P.S. Без ковычек конечно.

9 Ответ от галя 2015-04-10 14:06:30

  • Зарегистрирован: 2015-04-10
  • Сообщений: 2
Re: Первый вход в phpmyadmin после установки.

Здравствуйте. Я начинаю изучать php и mysql. Скачала denwer.Теперь хочу создать базу данных на сайте localhost/tools/phpmysql через Google и Opera. Но страница не открывается. Пишет сервер не найден. Дайте, пожалуйста совет.

10 Ответ от Hanut 2015-04-10 14:18:38

  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,724
Re: Первый вход в phpmyadmin после установки.

Насколько я понимаю, ссылка должна быть localhost/tools/phpmyadmin/

11 Ответ от галя 2015-04-10 22:07:08

  • Зарегистрирован: 2015-04-10
  • Сообщений: 2
Re: Первый вход в phpmyadmin после установки.

извините, я ошиблась, localhost/tools/phpmyadmin. Я не могу войти на эту страницу. Все время показывает сервер не найден.

12 Ответ от Hanut 2015-04-11 19:22:09

  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,724
Re: Первый вход в phpmyadmin после установки.

извините, я ошиблась, localhost/tools/phpmyadmin. Я не могу войти на эту страницу. Все время показывает сервер не найден.

Значит MySQL не запущен. Посмотрите в журнале ошибок MySQL, возможно там будут какие-то записи. После исправления ошибок перезапустите Денвер.

13 Ответ от Casha_Ghost 2018-11-12 16:46:56

  • Зарегистрирован: 2018-11-12
  • Сообщений: 1
Re: Первый вход в phpmyadmin после установки.

Здравствуйте уважаемые гуру!
Я делаю первые шаги в освоении php и для этого установил на локальном компьютере комплект программ на базе сервера Apache.
Все как бы нормально и работает.

Но при первом входе в phpmyadmin через файл index.php система запрашивает логин и пароль.

Я их ранее не вводил и не знаю в каком именно месте это следует сделать. Только пожалуйста не говорите — читай хелп. Для меня в нем пока слишком много незнакомой информации. Я делал попытки и не нашел точного однозначного ответа.
Подскажите пожалуйста, что следует сделать. Буду очень признателен.

14 Ответ от Hanut 2018-11-12 17:07:54

  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,724
Re: Первый вход в phpmyadmin после установки.

система запрашивает логин и пароль.

Пароль вы задавали при установке MySQL. Если ничего не меняли, то имя администатора будет root, пароль пустой.

15 Ответ от lazasll 2018-11-15 15:05:09

  • Зарегистрирован: 2018-11-15
  • Сообщений: 1
Re: Первый вход в phpmyadmin после установки.

Здравствуйте. Вот уже не первый день, пытаюсь войти на phpAdmin, сначала предлагал скачать файл, сейчас выдает вот Not Found

The requested URL /tools/phpmyadmin/ was not found on this server.
Apache/2.2.22 (Win32) Server at localhost Port 80

MySQL включен при помощи start-webserver.bat

подскажите пожалуйста, где могла закрасться ошибка

16 Ответ от Hanut 2018-11-15 15:47:01

  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,724
Re: Первый вход в phpmyadmin после установки.

/tools/phpmyadmin/ was not found on this server.

В логах веб-сервера посмотрите где он пытается найти данный путь.

17 Ответ от газ новичок 2020-11-12 18:33:38

  • Зарегистрирован: 2020-11-12
  • Сообщений: 1
Re: Первый вход в phpmyadmin после установки.

Боже мой, ув. Админ Вам задали безобиднейший вопрос! neutral
Логин: `root`
Пароль: «

P.S. Без ковычек конечно.

Paul, ОГРОМНОЕ Вам спасибо! Я тоже на ерунде застрял. root вводил в поле пароля. smile

18 Ответ от Grebo4ek 2021-06-21 18:17:11

  • Зарегистрирован: 2021-05-12
  • Сообщений: 8
Re: Первый вход в phpmyadmin после установки.

Спасибо ) вы решили и мой вопрос )

Сообщения 18

Страницы 1

Чтобы отправить ответ, вы должны войти или зарегистрироваться

Форум работает на PunBB , при поддержке Informer Technologies, Inc

Currently installed 7 official extensions . Copyright © 2003–2009 PunBB.

Похожие статьи