I’ve setup wamp
server on window. Then, I use MySQL root
password by cmd. As a result, when I access phpMyAdmin site, Access denied
appeared (Default user for phpMyAdmin is root
and password is blank/empty
). So, how could I change config
variables in phpMyAdmin with new password of root.
I’ve searched for solution on Internet, someone advise me add some line to config.inc.php
as:
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'Changed';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = false;
But, It seem not work. Thanks.
Bud Damyanov
29.4k6 gold badges42 silver badges52 bronze badges
asked May 28, 2014 at 9:28
11
Explain what video describe to resolve problem
After Changing Password of root (Mysql Account). Accessing to phpmyadmin page will be denied because phpMyAdmin use root/»(blank) as default username/password. To resolve this problem, you need to reconfig phpmyadmin. Edit file config.inc.php in folder %wamp%appsphpmyadmin4.1.14 (Not in %wamp%)
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'changed';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
If you have more than 1 DB server, add «i++» to file and continue add new config as above
Aron
15.6k3 gold badges31 silver badges64 bronze badges
answered May 28, 2014 at 17:19
Tiep PhanTiep Phan
12.2k3 gold badges37 silver badges41 bronze badges
5
You can change the mysql root password by logging in to the database directly (mysql -h your_host -u root) then run
SET PASSWORD FOR root@localhost = PASSWORD('yourpassword');
answered May 28, 2014 at 9:51
3
0) go to phpmyadmin don’t select any db
1) Click «Privileges». You’ll see all the users on MySQL’s privilege tables.
2) Check the user «root» whose Host value is localhost, and click the «Edit Privileges» icon.
3) In the «Change password» field, click «Password» and enter a new password.
4) Retype the password to confirm. Then click «Go» to apply the settings.
answered Jun 2, 2015 at 22:41
Mahmoud ZaltMahmoud Zalt
29.8k7 gold badges83 silver badges82 bronze badges
Change It like this, It worked for me. Hope It helps.
firs I did
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'changed';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
Then I Changed Like this…
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
answered Dec 4, 2014 at 4:48
I had to do 2 steps:
-
follow
Tiep Phan
solution … editconfig.inc.php
file … -
follow
Mahmoud Zalt
solution … change password within phpmyadmin
answered May 3, 2016 at 15:38
dsdsdsdsddsdsdsdsd
2,8306 gold badges39 silver badges55 bronze badges
Изменить или сбросить пароль от пользователя phpMyAdmin можно:
- по SSH. Этот способ подойдёт, если вы забыли пароль пользователя, под которым подключаетесь к phpMyAdmin.
- через интерфейс phpMyAdmin. Подойдёт, если вы знаете пароль и вам нужно его сменить.
В статье мы расскажем про оба способа.
Для сброса пароля по SSH вам понадобится доступ к root-пользователю MySQL. Если вы потеряли root-доступ к серверу баз данных, воспользуйтесь инструкцией.
Учётная запись, под которой вы подключаетесь к phpMyAdmin, — это обычный пользователь mySQL. Ниже мы расскажем, как сменить забытый пароль от такой учётной записи.
Как поменять пароль phpMyAdmin по SSH
-
1.
Подключитесь к серверу по SSH.
-
2.
Подключитесь к серверу баз данных командой:
Mysql -uroot -p’password’
Вместо password напишите пароль от root-пользователя MySQL.
-
3.
Узнайте версию MySQL при помощи команды:
-
4.
Используйте одну из команд в зависимости от версии MySQL:
5.7.6 и выше:
ALTER USER 'username' IDENTIFIED BY 'password';
5.7.5 и ниже:
SET PASSWORD FOR 'username'@'localhost' = PASSWORD('password');
Вместо username введите имя пользователя, вместо password введите ваш новый пароль.
-
5.
Перезагрузите таблицы привилегий командой:
Готово, вы сменили пароль от пользователя phpMyAdmin.
Как поменять пароль в phpMyAdmin
При помощи приложения можно поменять пароль как от учётной записи, под которой вы авторизованы, так и для других учётных записей MySQL.
-
1.
Войдите в веб-интерфейс.
-
2.
Нажмите Учетные записи пользователей:
-
3.
Напротив нужного имени нажмите Редактировать привилегии:
-
4.
Вверху страницы нажмите Изменить пароль:
-
5.
Введите пароль и подтвердите его, затем нажмите Вперёд:
Готово, пароль от учётной записи изменён.
Стандартные доступы phpMyAdmin
На облачных серверах REG.RU с шаблонами LEMP и LAMP phpMyAdmin устанавливается автоматически. При подключении к такому серверу по SSH вы увидите приветственное окно с доступами:
phpMyAdmin default password
От автора: Не подскажете, который час, месяц, день недели и год? А зачем вам? Да забыл свой новый пароль на базу данных! Тогда вам лучше с собой календарь носить или прочитать нашу статью о том, как изменить пароль MySQL.
Зачем менять пароль в MySQL
И в самом деле, зачем менять пароль? Пока все и так в целости и сохранности, никто не посягает на безопасность моей БД. Так говорил один мой знакомый, а на следующий день обнаружил, что не может «отомкнуть» своим «супернадежным» паролем админку собственного сайта, развернутого на основе одной из CMS. Только на следующий день благодаря помощи нанятых админов ему удалось «прорваться» на собственный ресурс. Когда недалеко «гром грянул», то большая часть остальных знакомых и друзей начали массово в MySQL изменять пароль root.
Надеюсь, этот случай также станет для вас чужим примером, на котором следует учиться. Поэтому рассмотрим все средства, с помощью которых в этой СУБД можно установить более надежный пароль.
Учетные записи в phpMyAdmin
Программная оболочка phpMyAdmin имеет на своем «борту» множество полезных средств для администрирования СУБД. В том числе и для управления правами пользователей, настройками их привилегий.
Чтобы узнать, под какой учетной записью вы вошли на сервер баз данных, перейдите на главную страницу приложения (если вы зашли в другой раздел административной части). Для этого нажмите на значок логотипа программы, расположенный в верхнем левом углу.
Бесплатный курс по PHP программированию
Освойте курс и узнайте, как создать веб-приложение на PHP с полного нуля
Получить курс сейчас!
В виджете «Сервер баз данных» (верхний правый угол основной страницы phpMyAdmin) указана пользовательская запись, «под которой» вы находитесь сейчас в СУБД. Это пригодится, если нужно срочно изменить пароль MySQL, а имя учетной записи не знаете или забыли. Всякое может быть! Ну, как в случае с паролем, который описан в начале статьи 🙂
Теперь переходим в раздел «Пользователи», который находится в основном меню сверху. Здесь в таблице «Обзор учетных записей» выбираем нужную учетку (ставим слева галочку), а затем жмем на ссылку «Редактирование привилегий».
Во всплывающем окне «Редактирование привилегий: Пользователь ‘root’@’localhost’» переходим ниже по настройкам к пункту «Изменить пароль». Во второе поле вводим значение пароля и повторяем его рядом.
Если нужно в MySQL сменить пароль root срочно, тогда воспользуйтесь опцией случайного генерирования его значений. Для этого нажмите на кнопку «Генерировать», и в окошке рядом появится сгенерированный программой пароль.
Эта функция является удобной тем, что сгенерированный пароль автоматически подставляется в поля для ввода нового значения и подтверждения. Чтобы внесенные изменения вступили в силу, нужно нажать «ОК». Новый пароль будет запрошен системой СУБД после перезапуска сервера MySQL.
Если вы воспользовались опцией генерирования случайного сочетания символов, чтобы в MySQL сменить пароль root, то советую его значение где-нибудь сохранить. Так как этот пароль не является ассоциативным для вас.
Средства командной строки
Для начала поиграем в «шпионские игры». Чур, я Джеймс Бонд! Извините, наверное, не наигрался в детстве :). Но что-то в этом есть немного таинственного и «разведчиского».
В общем, с помощью CMD выведем все пароли и учетные записи пользователей, зарегистрированные на сервере MySQL. Для этого мы войдем в таблицу системной БД и сделаем выборку. Эти сведения также могут нам пригодиться, чтобы в MySQL сменить пароль.
Пошаговая схема «взлома»:
Запускаем CMD.
Запускаем «экзешник» MySQL под своей учеткой и паролем:
Z:usrlocalmysql—5.5binmysql.exe —u root |
Бесплатный курс по PHP программированию
Освойте курс и узнайте, как создать веб-приложение на PHP с полного нуля
Получить курс сейчас!
В случае удачного «захода» внизу отобразится информация, что вы в командном мониторе СУБД. Затем указывается версия сервера и всякая другая неинтересная для настоящего шпиона информация.
Теперь нам нужно попасть в системную БД. Сначала выделяем ее с помощью команды USE:
Выполним запрос на выборку данных из системной таблицы user. И перед тем, в MySQL как установить пароль root, посмотрим, какие еще учетные записи существуют на сервере:
select user,host,password from user; |
Для дальнейших экспериментов нам потребуется новый пользователь. Создадим его через интерфейс phpMyAdmin (вкладка «Пользователи» в основном меню). Задаем ему имя, хост (локальный), пароль и повторяем пароль. И жмем на «Добавить пользователя».
Мы рассмотрим, как изменить пароль root MySQL, на примере нового пользователя. Смотрите, кто появился! Вован, сколько дней не виделись. Ты как раз вовремя.
После создания «Вована» заходим на сервер баз данных через командную строку под своим логином. Затем выделяем системную БД и опять выводим список всех учетных записей и их пароли.
В таблице появился новый пользователь vovan . Но как сменить пароль MySQL, если для этого пользователя он выводится в виде очень длинной цепочки символов? Это потому, что к его значению применено хеширование. Вы главное не волнуйтесь. Сейчас мы этого Вована «обеспоролим».
Вот запрос на установку для учетной записи vovan пустого пароля:
UPDATE mysql.user SET Password=PASSWORD(») WHERE User=‘vovan’ AND Host=‘localhost’; |
Введите этот запрос в окно CMD и запустите на выполнение (нажмите «Enter»). После чего снова посмотрим на нашу таблицу юзеров сервера MySQL.
О, чудо! Вован «беспарольным» остался. Таким образом можно не только Вована «обработать», но и более «серьезных» пользователей. Это еще один способ, как можно поменять пароль root MySQL. Тогда код запроса будет выглядеть следующим образом:
UPDATE mysql.user SET Password=PASSWORD(‘new_пароль’) WHERE User=‘root’ AND Host=‘localhost’; |
Вот теперь можно смело менять пароли и направо, и налево. Главное, чтобы задаваемые пароли были надежными, и не на основе «календарика»
Бесплатный курс по PHP программированию
Освойте курс и узнайте, как создать веб-приложение на PHP с полного нуля
Получить курс сейчас!
Хотите изучить MySQL?
Посмотрите курс по базе данных MySQL!
Смотреть
I’ve setup wamp
server on window. Then, I use MySQL root
password by cmd. As a result, when I access phpMyAdmin site, Access denied
appeared (Default user for phpMyAdmin is root
and password is blank/empty
). So, how could I change config
variables in phpMyAdmin with new password of root.
I’ve searched for solution on Internet, someone advise me add some line to config.inc.php
as:
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'Changed';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = false;
But, It seem not work. Thanks.
Bud Damyanov
29.4k6 gold badges42 silver badges52 bronze badges
asked May 28, 2014 at 9:28
11
Explain what video describe to resolve problem
After Changing Password of root (Mysql Account). Accessing to phpmyadmin page will be denied because phpMyAdmin use root/»(blank) as default username/password. To resolve this problem, you need to reconfig phpmyadmin. Edit file config.inc.php in folder %wamp%appsphpmyadmin4.1.14 (Not in %wamp%)
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'changed';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
If you have more than 1 DB server, add «i++» to file and continue add new config as above
Aron
15.6k3 gold badges31 silver badges64 bronze badges
answered May 28, 2014 at 17:19
Tiep PhanTiep Phan
12.2k3 gold badges37 silver badges41 bronze badges
5
You can change the mysql root password by logging in to the database directly (mysql -h your_host -u root) then run
SET PASSWORD FOR root@localhost = PASSWORD('yourpassword');
answered May 28, 2014 at 9:51
3
0) go to phpmyadmin don’t select any db
1) Click «Privileges». You’ll see all the users on MySQL’s privilege tables.
2) Check the user «root» whose Host value is localhost, and click the «Edit Privileges» icon.
3) In the «Change password» field, click «Password» and enter a new password.
4) Retype the password to confirm. Then click «Go» to apply the settings.
answered Jun 2, 2015 at 22:41
Mahmoud ZaltMahmoud Zalt
29.8k7 gold badges83 silver badges82 bronze badges
Change It like this, It worked for me. Hope It helps.
firs I did
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'changed';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
Then I Changed Like this…
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
answered Dec 4, 2014 at 4:48
I had to do 2 steps:
-
follow
Tiep Phan
solution … editconfig.inc.php
file … -
follow
Mahmoud Zalt
solution … change password within phpmyadmin
answered May 3, 2016 at 15:38
dsdsdsdsddsdsdsdsd
2,8306 gold badges39 silver badges55 bronze badges
Рано или поздно любой владелец сайта сталкивается с непосредственной работой с базой данных. Для этих целей был разработан phpmyadmin, который в большинстве случаев уже установлен и настроен на вашем хостинге. Но часто от вебмастера требуется изменить пароль root`а на phpmyadmin. Вроде простая задача, но почему-то у большинства людей эта проблема вызывает немалые сложности. Лично у меня так и было.
У меня эта потребность возникла после переустановки операционной системы на VPS-сервере от Majordomo, после которой я просто не смог войти в phpmyadmin с паролем по-умолчанию. Пришлось срочно его менять.
Сам пароль для доступа к phpmyadmin совпадает с паролем root к серверу MySQL, который вы указывали при установке. Если Вы этот пароль по какой-то причине забыли, то восстановить его можно достаточно просто. Способ восстановления пароля описан в статье: Как изменить пароль root`а на MySQL-сервер?
Есть еще один небольшой нюанс, который следует учитывать, когда вы используете phpmyadmin – это способ авторизации этой надстройки.
За все это отвечает только один конфигурационный файл phpmyadmin – config.inc.php, который в операционной системе FreeBSD находится в директории /usr/local/www/phpMyAdmin. Содержимое моего файла, который является боевым, вот:
<?php
$cfg['blowfish_secret'] = 'wertyukj';
$cfg['Servers'][1]['auth_type'] = 'cookie';
$cfg['Servers'][1]['user'] = 'root';
$cfg['Servers'][1]['password'] = 'wertyukjndwy3cn3';
$cfg['Servers'][1]['AllowNoPassword'] = false;
$cfg['Servers'][1]['extension'] = 'mysql';
?>
Теперь давайте разберем где тут что и как…
- blowfish_secret – это произвольная фраза, которая нужна для шифрования паролей в куках. Надежнее поменять ее на любую другую, только не стандартную.
- auth_type – это тип авторизации, который может принимать 2 значения: config и cookie:
- config – указывает на то, что логин/пароль будут браться из этого файла (две следующие строчки user и password). При таком режиме, успешный вход будет всегда, когда вы или кто-то другой просто зайдет на ваш домен, где размещается также phpmyadmin и может получит возможность натворить там всяких пакостей.
- cookie – указывает на то, что логин/пароль будут спрашиваться каждый раз, как кто-то переходит по адресу, где лежит phpmyadmin. Правильный пароль будет храниться в зашифрованном виде в куках на вашем компьютере.
- user и password – это имя пользователя (в нашем случае должен быть root) и пароль. В этом конфигурационном файле они добавлены просто для примера и при использовании cookie их можно вообще удалить.
- AllowNoPassword – может принимать значения true (истина) и false (ложь). Собственно разрешается вход без пароля (true) или нет (false)
- extension – может принимать значение mysql и mysqli. Первое нужно указывать в случае если вы используете phpmyadmin в связки MySQL ниже 4.1.3. Второй если используете версию MySQL выше 4.1.3.
Этих параметров конечно же больше, тут приведены только самые основные, которые необходимы для нормальной работы phpmyadmin.
Теги:
и MySQL
Комментарии
Бывают ситуации, когда необходимо сменить пароль в админку, без доступа в саму админку. Например, в прошлой заметке, мы рассмотрели пример конструктора сайтов SiteBlock.RU, где есть два скрытых пользователя в базе данных (как получить доступ к скрытым пользователям в siteblock, описано ниже: Ситуация 3). Чтобы получить доступ в админку под одним из пользователей, можно сменить пароль любого пользователя WordPress, через базу данных.
При этом, простая смена пароля, не всегда помогает. Например, если это злоумышленники создали пользователя, вам будет мало просто сменить пароль. О разных нюансах при смене пароля в WordPress через базу данных (phpMyAdmin), мы рассмотрим с вами ниже.
Нужно напомнить, что если был забыт пароль от админки WordPress, можно воспользоваться функцией сброса пароля на странице входа в админ панель WordPress. Достаточно, нажать на ссылку:
Забыли пароль
После чего, необходимо будет указать свой e-mail, который зарегистрирован в админке WordPress. Вам будет отправлено на почту письмо со ссылкой, по которой необходимо перейти и создать новый пароль. Все).
Как сменить / сбросить пароль в PhpMyAdmin от админки WordPress?
При этом, если вы обнаружили в базе данных нового пользователя или подозреваете, что вход в вашу админ панель сайта на WordPress, имеет еще кто то, вам поможет нижеприведенный способ. Либо, вы действительно забыли пароль и потеряли доступ к почте, которая была указана в админке WordPress.
Не используйте данный способ, в противоправных / незаконных целях. Данный способ, приведен исключительно для:
- защиты своего сайта на WordPress от взлома и удаления следов взлома
- восстановления пароля WordPress, если забыт / утерян доступ к электронной почте
Рекомендую настоятельно использовать данный способ проверки, если пользуетесь фриланс биржами. Редко, но, недобросовестные исполнители, могут создавать скрытого пользователя в админке себе «на будущее». Проверяйте базу данных на наличие посторонних пользователей, каждый раз, когда кто то из посторонних работал с вашим сайтом.
Ситуация № 1.
Вы действительно забыли пароль, а доступ к почте – утерян.
Зайдите в панель phpMyAdmin с использованием учетных данных, предоставленных вам хостинг-провайдером. Зачастую, адрес и необходимые данные (логин / пароль) есть в панели управления хостингом. В редких случаях, данные высылаются хостером на почту. При необходимости, вы можете обратится за помощью в техподдержку хостинга.
После входа в phpMyAdmin:
1. Выбираем свою базу данных сайта;
2. Ищем в ней таблицу записей wp_users;
3. В открывшемся окно, мы увидим доступные учетки всех пользователей сайта;
4. Выбираем необходимого пользователя;
5. Нажимаем «Изменить»;
6. Откроется новая вкладка. Ищем в ней поле user_pass и задаем новый пароль;
Пароль в поле user_pass, не получится использовать, поскольку он зашифрован.
7. В соседнем поле, обязательно указываем опцию для шифрования – MD5;
8. Подтверждаем изменения.
После установки нового пароля в phpMyAdmin, вы сможете зайти в свою админ-панель WordPress, указав логин и новый пароль.
Ситуация 2.
В базе данных, появился новый пользователь, которого вы не добавляли.
После входа в phpMyAdmin:
1. Выбираем свою базу данных сайта;
2. Ищем в ней таблицу записей wp_users;
3. В открывшемся окно, мы увидим доступные учетки всех пользователей сайта;
4. Выбираем необходимого пользователя;
5. Нажимаем «Удалить»
Стоит на всякий случай предупредить, что речь идет о той ситуации, когда в таблице записей wp_users, присутствует несколько пользователей и один из них, вам не известен. Как и упоминалось ранее, подобные ситуации могут возникать после того, как вы кому то предоставляли доступ к сайту для оказания вам помощи. Недобросовестный исполнитель, мог создать скрытого пользователя в базе данных (phpMyAdmin). Либо, ваш сайт был взломан и злоумышленники, создали нового пользователя. В любом случае, не удаляйте ни в коем случае пользователя, если он в таблице записей wp_users – один.
Ситуация 3.
Предположим, вам необходимо сменить пароль одного из пользователей WordPress, при этом, вы не хотите удалять данного пользователя. Однако, хотите заблокировать ему доступ в админ-панель WordPress.
Если применить способ из первого способа, пользователь, когда не сможет войти в админку, просто сбросит пароль через страницу входа, восстановив доступ при помощи своей электронной почты (мы рассматривали данный способ восстановления, в самом начале заметки).
Если использовать второй способ, мы просто удалим пользователя и потеряем настройки его профиля. Порой, бывает важно сохранить пользователя и его настройки. Это актуально, если речь идет об удалении «Супер Администратор» (Super Administrator) или «Администратор». Удалив данных пользователей, мы можем потерять определенные настройки админки WordPress. Рассмотрим это на конкретном примере.
Как упоминал в самом начале данной заметки, если рассмотреть конструктор сайтов siteblock.ru из предыдущей заметки, то там есть два скрытых пользователя:
- «ruslan»
- «boss»
Чтобы не удалять данных пользователей, при этом, заблокировать им доступ в админ-панель WordPress, мало просто поменять пароль. Они с легкостью восстановят его, через страницу входа, о чем говорили выше. Что тогда нужно сделать, чтобы пользователь «ruslan» и «boss» не смогли восстановить пароль и попасть в нашу админку?
Важно знать! Если удалить пользователя «ruslan», вы потеряете всю кастомизацию админки пользователя «Admin», которая предоставляется создателями конструктора siteblock.ru.
Изменения email в PhpMyAdmin для пользователей WordPress.
Верно, необходимо сменить почту для конкретного пользователя, чтобы пользователь не смог выполнить восстановление пароля через страницу входа.
Для этого, открываем свою базу данных и ищем таблицу записей wp_users. Выбираем необходимого пользователя и нажимаем «Изменить»:
В открывшейся новой вкладке, ищем поле user_email и указываем новую почту:
Сохраняем изменения. Теперь, можно сменить и пароль. При этом, не меняйте имени пользователя. Таким образом, вы можете сменить e-mail для каждого пользователя WordPress. Однако, для смены почты админа «Супер Администратор» (Super Administrator) или «Администратор», необходимо внести еще изменения в таблице записей wp_options. Об этом, ниже.
Как сменить e-mail администратора в WordPress без подтверждения?
Если вам, необходимо сменить почту для главного Администратора сайта на WordPress (актуально и в тех ситуациях, когда на сайте, только один админ), помимо внесения изменений в таблицу записей wp_users, необходимо сменить электронный адрес админа в PhpMyAdmin. Ниже, мы продолжим рассматривать это на примере пользователя «ruslan».
Необходимо перейти в таблицу записей wp_options. Ищем admin_email, после чего нажимаем «Изменить»:
В новом окне, ищем поле option_value и указываем новую почту:
Не забываем сохранять изменения. Таким образом, мы выяснили, что пользователь «ruslan», является админом нашего конструктора siteblock.ru и может делать с нашим сайтом, что захочет, без нашего ведома. Мы же, в свою очередь, сменили почту и изменили пароль. При этом, сохранив пользователя. Теперь, пользователь «ruslan», не сможет выполнить сброс пароля через страницу входа WordPress. При этом, лучше указывать реальную почту, чтобы самому можно было контролировать админку и восстанавливать ее.
Важно! Для каждого пользователя WordPress, нужно указывать новый e-mail. Не используйте один e-mail для всех пользователей.
При этом, данный способ, мы можем использовать на всех сайтах, который работают под управлением CMS WordPress. Вы можете сменить почту / e-mail администратора в WordPress без подтверждения.
Более того, способ описанный в данной заметке, позволяет получить доступ к скрытым пользователям в конструкторе сайтов SiteBlock.RU и взять под свой контроль, учетки данных пользователей WordRpess.
Заключение.
Способы выше, позволяют получить доступ к админ-панели WordPress, если были утеряны пароли и электронные адреса для восстановления пароля через страницу входа. Также, это позволяет восстановить доступ к сайту, если смена паролей и электронного адреса в админ-панели WordPress, произошла без вашего доступа.
В случае, если был произведен взлом сайта WordPress, необходимо менять пароли от:
- панели управления хостингом
- электронной почты
- FTP
- PhpMyAdmin
- админки WordPress
Staying secure online has never been more important, especially for businesses. Password selection and maintenance both play an essential role in security. Unfortunately, they often get neglected, especially on local installations such as XAMPP.
However, local software can be just as vulnerable to malicious activity, and by default XAMPP typically ships without a root password for the MySQL database. Adding one and changing it regularly can help keep your data secure and prevent the loss of hours of hard work.
In this article, we’ll explain why you might want to change your XAMPP MySQL password. Then we’ll walk you through three different methods you can use. Let’s get started!
Why You Might Want to Change Your MySQL Password
There are several reasons why you might want (or need) to change your MySQL password. First and most important: when you install XAMPP on your computer, the password for the “root” user is left empty. This means that there is no security on this account by default.
The root user is essentially the administrator account—it has unrestricted access to all commands and files in the system. As such, having no password protection for this user is a major security hole. Anyone could log in to the user account and edit files on your local installation.
Apart from that, it’s also a smart security practice to change your passwords periodically. Doing so helps prevent malicious activity, particularly if you use the same password in multiple places. Regularly changing passwords can help offset issues that might arise without this practice.
Finally, you may have simply forgotten your password and, as a result, can’t access files or functions that you need on your local XAMPP WordPress installation. Whatever the reason, being able to change MySQL passwords is a valuable skill that could come in handy.
How to Change Your MySQL Password in XAMPP (3 Methods)
As with most WordPress tasks, there are multiple ways to change the MySQL password. The method you should use will depend on exactly what you need to do and what interface you’re most comfortable with: the command line, a Graphical User Interface (GUI), or text files. With that in mind, let’s take a look at three ways to change your MySQL password in XAMPP.
1. Change Your MySQL Password Using the XAMPP Shell
Using the XAMPP shell is generally going to be the simplest and quickest method for changing your MySQL password. It does involve using the command line, which can seem daunting at first.
However, it’s actually fairly straightforward. This is also the method you’ll want to use if you’ve forgotten your existing MySQL password and need to reset it.
Note that these commands are the same whether you’re using Windows or macOS. Since this is a unique shell specific to XAMPP, any typical differences between the platforms won’t apply.
To get started, launch your XAMPP Control Panel and click on the Shell button on the right-hand side.
This will open up a new window with a command prompt. Enter the following command and press the Enter/Return key:
mysqladmin -u root password
The shell will prompt you to enter a new password. Press Enter/Return again, and you’ll be asked to confirm the new password.
Once you’ve done that, you’re finished and can close the shell window.
2. Change Your XAMPP MySQL Password via phpMyAdmin
The second method involves using the phpMyAdmin GUI to change your XAMPP MySQL password. This technique is relatively simple, but generally not as quick as the command line method.
First, you need to access the phpMyAdmin interface. Pull up the XAMPP Control Panel and click on Admin in the MySQL row:
PhpMyAdmin will open in a browser window:
If you’re asked to log in, use the username “root” and enter your root password. If you haven’t set one yet, you can leave it blank.
Next, navigate to the User accounts section in the main menu bar, and locate the root user for localhost in the list:
Next, you can click on Edit privileges beside the root user, then select Change password at the top of the page.
On the next screen, simply enter the password you want to use:
When you’re finished, you can click on the Go button in the bottom-right to save the change. That’s it!
3. Change Your XAMPP MySQL Password by Editing the config.inc.php File
If you find yourself in a situation where you know your password is correct, but it isn’t working for whatever reason, this is the method for you. It involves opening up a text file and editing the password directly in it.
First, open the XAMPP Control Panel and click on the Explorer button on the right-hand side of the window:
This will launch a file browser in the XAMPP folder. Next, you can open the phpMyAdmin folder and locate the config.inc.php file:
The config.inc.php file in Windows.
You can open this file in your favorite text editor, or simply double-click on it to open it in the default program.
The line you’re looking for is $cfg['Servers'][$i]['password'] = 'YourPassword';
. Here’s what it looks like:
Once you locate it, you can enter your desired password between the single quotes, and then save the file. That’s all there is to it!
Summary
Whether you’ve forgotten your XAMPP MySQL password or you want to take your security up a notch, there are multiple methods you can use to change it. Updating your password helps keep your data secure, and provides an additional layer of defense against malicious activity.
In this article, we covered how to change your MySQL password on an XAMPP installation using three methods, which include using the command line, going through the phpMyAdmin GUI, and editing a file directly. You can choose whichever one suits your workflow best.
If you take security seriously and want to ensure that all of your WordPress sites are protected, consider hosting with Kinsta. Our plans offer the security, speed, and support your site needs to operate at its best.
Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:
- Easy setup and management in the MyKinsta dashboard
- 24/7 expert support
- The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability
- An enterprise-level Cloudflare integration for speed and security
- Global audience reach with up to 35 data centers and 275 PoPs worldwide
Test it yourself with $20 off your first month of Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.
Staying secure online has never been more important, especially for businesses. Password selection and maintenance both play an essential role in security. Unfortunately, they often get neglected, especially on local installations such as XAMPP.
However, local software can be just as vulnerable to malicious activity, and by default XAMPP typically ships without a root password for the MySQL database. Adding one and changing it regularly can help keep your data secure and prevent the loss of hours of hard work.
In this article, we’ll explain why you might want to change your XAMPP MySQL password. Then we’ll walk you through three different methods you can use. Let’s get started!
Why You Might Want to Change Your MySQL Password
There are several reasons why you might want (or need) to change your MySQL password. First and most important: when you install XAMPP on your computer, the password for the “root” user is left empty. This means that there is no security on this account by default.
The root user is essentially the administrator account—it has unrestricted access to all commands and files in the system. As such, having no password protection for this user is a major security hole. Anyone could log in to the user account and edit files on your local installation.
Apart from that, it’s also a smart security practice to change your passwords periodically. Doing so helps prevent malicious activity, particularly if you use the same password in multiple places. Regularly changing passwords can help offset issues that might arise without this practice.
Finally, you may have simply forgotten your password and, as a result, can’t access files or functions that you need on your local XAMPP WordPress installation. Whatever the reason, being able to change MySQL passwords is a valuable skill that could come in handy.
How to Change Your MySQL Password in XAMPP (3 Methods)
As with most WordPress tasks, there are multiple ways to change the MySQL password. The method you should use will depend on exactly what you need to do and what interface you’re most comfortable with: the command line, a Graphical User Interface (GUI), or text files. With that in mind, let’s take a look at three ways to change your MySQL password in XAMPP.
1. Change Your MySQL Password Using the XAMPP Shell
Using the XAMPP shell is generally going to be the simplest and quickest method for changing your MySQL password. It does involve using the command line, which can seem daunting at first.
However, it’s actually fairly straightforward. This is also the method you’ll want to use if you’ve forgotten your existing MySQL password and need to reset it.
Note that these commands are the same whether you’re using Windows or macOS. Since this is a unique shell specific to XAMPP, any typical differences between the platforms won’t apply.
To get started, launch your XAMPP Control Panel and click on the Shell button on the right-hand side.
This will open up a new window with a command prompt. Enter the following command and press the Enter/Return key:
mysqladmin -u root password
The shell will prompt you to enter a new password. Press Enter/Return again, and you’ll be asked to confirm the new password.
Once you’ve done that, you’re finished and can close the shell window.
2. Change Your XAMPP MySQL Password via phpMyAdmin
The second method involves using the phpMyAdmin GUI to change your XAMPP MySQL password. This technique is relatively simple, but generally not as quick as the command line method.
First, you need to access the phpMyAdmin interface. Pull up the XAMPP Control Panel and click on Admin in the MySQL row:
PhpMyAdmin will open in a browser window:
If you’re asked to log in, use the username “root” and enter your root password. If you haven’t set one yet, you can leave it blank.
Next, navigate to the User accounts section in the main menu bar, and locate the root user for localhost in the list:
Next, you can click on Edit privileges beside the root user, then select Change password at the top of the page.
On the next screen, simply enter the password you want to use:
When you’re finished, you can click on the Go button in the bottom-right to save the change. That’s it!
3. Change Your XAMPP MySQL Password by Editing the config.inc.php File
If you find yourself in a situation where you know your password is correct, but it isn’t working for whatever reason, this is the method for you. It involves opening up a text file and editing the password directly in it.
First, open the XAMPP Control Panel and click on the Explorer button on the right-hand side of the window:
This will launch a file browser in the XAMPP folder. Next, you can open the phpMyAdmin folder and locate the config.inc.php file:
The config.inc.php file in Windows.
You can open this file in your favorite text editor, or simply double-click on it to open it in the default program.
The line you’re looking for is $cfg['Servers'][$i]['password'] = 'YourPassword';
. Here’s what it looks like:
Once you locate it, you can enter your desired password between the single quotes, and then save the file. That’s all there is to it!
Summary
Whether you’ve forgotten your XAMPP MySQL password or you want to take your security up a notch, there are multiple methods you can use to change it. Updating your password helps keep your data secure, and provides an additional layer of defense against malicious activity.
In this article, we covered how to change your MySQL password on an XAMPP installation using three methods, which include using the command line, going through the phpMyAdmin GUI, and editing a file directly. You can choose whichever one suits your workflow best.
If you take security seriously and want to ensure that all of your WordPress sites are protected, consider hosting with Kinsta. Our plans offer the security, speed, and support your site needs to operate at its best.
Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:
- Easy setup and management in the MyKinsta dashboard
- 24/7 expert support
- The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability
- An enterprise-level Cloudflare integration for speed and security
- Global audience reach with up to 35 data centers and 275 PoPs worldwide
Test it yourself with $20 off your first month of Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.
I’ve set up mysql and phpmyadmin and chose not to set a password when installing hoping that once set up i could login with root and no password but i get the following error from phpmyadmin:
Login without a password is forbidden by configuration (see AllowNoPassword)
I have previously moved the phpmyadmin folder to /var/www/
I have tried changing the following line
$cfg['Servers'][$i]['AllowNoPassword'] = false;
to
$cfg['Servers'][$i]['AllowNoPassword'] = true;
but still had no success, so i am wondering is there a way i can change the root passwords for both so i can access phpmyadmin and create databases.
Rinzwind
288k39 gold badges561 silver badges701 bronze badges
asked Apr 4, 2012 at 5:15
1
You can change the mysql root password by logging in to the database directly (mysql -h your_host -u root
) then run
SET PASSWORD FOR root@localhost = PASSWORD('yourpassword');
phpmyadmin should use that password so not quite sure what you mean by «for both».
Make sure to set the new password into phpmyadmin’s config.inc.php
too, at line
$cfg['Servers'][$i]['password'] = 'yourpassword';
Otherwise, phpmyadmin may not work, echoing
Access denied for user 'user'@'localhost' (using password: YES)
answered Apr 4, 2012 at 6:00
geermc4geermc4
1,4931 gold badge13 silver badges20 bronze badges
4
It depends on your configuration.
Follow the instruction below to reconfigure phpmyadmin, and reset MySQL password.
- Ctrl + Alt + T to launch terminal
sudo dpkg-reconfigure phpmyadmin
- Connection method for MySQL database for phpmyadmin: unix socket
- Name of the database’s administrative user:
root
- Password of the database’s administrative user: mysqlsamplepassword
- MySQL username for phpmyadmin: root
- MySQL database name for phpmyadmin: phpmyadmin
- Web server to reconfigure automatically: apache2
- ERROR 1045
- ignore
sudo dpkg-reconfigure mysql-server-5.5
- New password for the MySQL «root» user: mysqlsamplepassword
- Repeat password for the MySQL «root» user: mysqlsamplepassword
-
After all this run following command on terminal to secure your mysql server.
sudo mysql_secure_installation -
Enter current password for root (enter for none): mysqlsamplepassword
- Change the root password? [Y/n] n
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y
Wish it helps!
Have a nice day!
Anwar
74.8k31 gold badges189 silver badges306 bronze badges
answered Aug 13, 2012 at 7:30
Amigo ChanAmigo Chan
6977 silver badges6 bronze badges
2
I recently came across this very same issue Ubuntu 12.04. I just couldn’t seem to login with root & no password. I set the AllowNoPassword setting to TRUE in the config. Later I found out that I was editing the wrong config.inc.php file to add the AllowNoPassword setting.
Edit:
/etc/phpmyadmin/config.inc.php
Not:
/usr/share/phpmyadmin/config.inc.php
I believe the first is the debian local config file, which will override the usr version.
answered May 31, 2012 at 1:20
jjwdesignjjwdesign
3101 silver badge12 bronze badges
1