Change and Reset MySQL root Password Изменения и MySQL Сброс пароля
Other then the ways specified Другие способы затем указанного here здесь to reset and change the root password for mySQL database in the case that the password is forgotten or lost, the following instructions explain in details the alternative way at the last part of the guide, where no additional file needs to be created: переустановить и изменить пароль администратора для mySQL базы данных в случае, если пароль забыли или потеряли, следующие инструкции в деталях объяснить, альтернативные пути в последней части руководства, где никаких дополнительных файл должен быть создан:
- Login as root to the Windows or Unix-like (Unix, Linux or BSD) machine with the MySQL server. Войти в качестве суперпользователя для Windows или Unix-подобных (Unix, Linux или BSD) машина с MySQL сервером.
- Stop the MySQL server by using either of the following command: Остановить MySQL сервер, используя любой из следующих команды:
Linux: /etc/rc.d/init.d/mysql stop Linux: / и т.д. / rc.d / init.d / mysql остановки
FreeBSD: /usr/local/etc/rc.d/mysql-server.sh stop FreeBSD: / usr / местные / и т.д. / rc.d / mysql-server.sh остановки - Open the mysql server startup script (ie mysql-server.sh - the file executed to start or stop MySQL server. Открыть mysql сервера запуске сценария (например, mysql-server.sh - файл запускается для начала или остановки сервера MySQL.
- Add –skip-grant-tables to the end of the line that contains the mysqld_safe command as its parameter. Add-пропустить-грант столы для окончания строки, которая содержит mysqld_safe команду в качестве своего параметра.
- Start MySQL server with the following command: Запустите сервер MySQL с помощью команды:
Linux: /etc/rc.d/init.d/mysql start Linux: / и т.д. / rc.d / init.d / mysql начать
FreeBSD: /usr/local/etc/rc.d/mysql-server.sh start FreeBSD: / usr / местные / и т.д. / rc.d / mysql-server.sh начать - Alternatively, start the MySQL server directly and skip the editing with the following command: Или начните MySQL сервером напрямую и пропустить редактирования с помощью команды:
mysqld_safe –skip-grant-tables & mysqld_safe-пропустить-грант-таблиц и
Depending on your path environment, you may need to point to the correct directory where mysqld_safe is instead. В зависимости от условий вашем пути, вам может потребоваться указать на правильный каталог, где это вместо mysqld_safe.
- Run the following commands to login as the mysql user and connect to mysql user/permission database: Выполнить следующую команду к входу в качестве пользователя mysql и подключиться к mysql пользователь / разрешение базе данных:
# mysql -u root mysql # Mysql-у корня mysql
- Run the update queries to change the MySQL password: Выполнить обновление запросов на изменение MySQL пароль:
mysql> UPDATE user SET Password=PASSWORD(’newrootpassword’) WHERE User=’root’; mysql> UPDATE пользователя SET password = password ( 'newrootpassword "), где пользователь =' корень ';
mysql> FLUSH PRIVILEGES; mysql> FLUSH привилегий;Note: Replace newrootpassword with the new root password for MySQL server. Примечание: вместо newrootpassword с нового пароля для MySQL-сервера. Flush Privileges is needed to making the password change effect immediately. Флеш привилегиях необходимо сделать изменение пароля в силу немедленно.
- Exit mysql database client by typing exit. Выход из базы данных mysql клиент, набрав выхода.
- Stop MySQL server with commands listed at step 2. Остановить MySQL сервер с командами, перечисленные на шаге 2.
- Open the mysql server startup script edit in step 3 again and remove the –skip-grant-tables parameter that has been added. Открыть mysql сервера запуске сценария прав в шаге 3, вновь и удалить-пропустить-грант-таблицы параметров, которые были добавлены.
- Start MySQL server by using command from step 5 or 6. Запустите сервер MySQL с помощью команды с шагом 5 или 6.
For Redhat Linux users, use the following instructions as the root user of Redhat Linux machine: Для пользователей Linux Redhat, используйте следующие инструкции, как корневой пользователь Redhat Linux машине:
- Stop MySQL process by using command: Остановить процесс MySQL, используя команду:
# killall mysqld # Killall mysqld
- Start the MySQL server with following options: Начните с сервером MySQL следующие варианты:
# /usr/libexec/mysqld -Sg –user=root & # / Usr / libexec / mysqld-SG-пользователя = корень и
- Start the MySQL client: Начать MySQL клиента:
# mysql # Mysql
You should see the following message: Вы должны увидеть следующее сообщение:
Welcome to the MySQL monitor. Добро пожаловать в MySQL монитор. Commands end with ; or g. Команды с конца, или g.
Your MySQL connection id is 1 to server version: 3.xx.xx Ваш идентификатор связи MySQL составляет 1 к серверу версия: 3.xx.xxType ‘help;’ or ‘h’ for help. Вид со справочными; "или" ч "о помощи. Type ‘c’ to clear the buffer. Тип "с" для очистки буфера.
mysql>
- Use mysql database: Использование базы данных mysql:
mysql> USE mysql mysql> USE mysql
You should see the following message: Вы должны увидеть следующее сообщение:
Reading table information for completion of table and column names Чтение таблицы информацию для завершения таблицы и имена столбцов
You can turn off this feature to get a quicker startup with -A Вы можете отключить эту функцию, чтобы получить быстрее загрузке -Database changed База данных изменена
- Then, update the password for the root user with the following command: Затем обновить пароль для корневой пользователь с помощью команды:
UPDATE user SET password=password(”newpassword”) WHERE user=”root”; UPDATE множество пользователей, пароль, пароль = ( "newpassword"), где пользователь = "корень";
Replace newpassword with your desired password. Заменить newpassword в нужный пароль. You should see the following message: Вы должны увидеть следующее сообщение:
Query OK, 2 rows affected (0.03 sec) Query OK, 2 строк, (0,03 сек)
Rows matched: 2 Changed: 2 Warnings: 0 Строки соответствуют: 2 Изменено: 2 Предупреждения: 0Rows affected may be different, but the Query OK should be there. Строк пострадавших могут быть разными, но Query OK должна быть там.
- Flush the database privileges to reload it in order to make the changes effective: Флеш базы данных привилегий перезагрузить его, с тем чтобы сделать изменения эффективными:
mysql> flush privileges; mysql> флеш привилегий;
You should get the following result: Вы должны получить следующий результат:
Query OK, 0 rows affected (0.02 sec) Query OK, 0 строк, (0,02 сек)
- Exit the MySQL client by typing exit. Выход MySQL клиент, набрав выхода.
- Kill the MySQL server process by typing killall mysqld. Убил сервер MySQL процесса, набрав killall mysqld.
- Then start MySQL again: Затем запустите MySQL снова:
/etc/init.d/mysqld start / и т.д. / init.d / mysqld начать
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. ВАЖНО: Это машина переведена страница, на которой предоставляется "как есть" без гарантий. Machine translation may be difficult to understand. Машинный перевод может быть трудным для понимания. Please refer to Обратитесь к original English article Английский оригинал статьи whenever possible. когда это возможно.
Share and contribute or get technical support and help at Доля и вклад или получить техническую поддержку и помощь в My Digital Life Forums Моя Цифровая жизнь форумах .
Related Articles Статьи по теме
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 3 Установка веб-сервера в FreeBSD 6,0 с 2,2 Apache, MySQL 5,0 и PHP 5 - Часть 3
- Reset the Root Password of MySQL Server Сбросить пароль пользователя root в MySQL сервере
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4 Установка веб-сервера в Windows XP с Apache2, PHP5 и MySQL4 - Часть 4
- Check and Optimize MySQL Database Automatically with Crontab/Cron Проверка и оптимизации данных MySQL автоматически с crontab / Cron
- How to Recover and Reset Gmail (Google Account) Password Как восстановить и Reset Gmail (Google аккаунт) Пароль
- How to Reset AdSense Password Not Associated with Google Account Как сбросить пароль AdSense не связан с учетной записью Google
- How to Reset WordPress Password to Recover Forgotten Secret Как сбросить пароль для WordPress восстанавливать забытые секрет
- Change Oracle Database User Password Изменение базы данных Oracle пароль пользователя
- Apple iPhone Root Password and Mobile User Password Apple iPhone пароль root и мобильных пароль пользователя
- Fix for Munin MySQL Monitoring Plugin Graph Not Showing or Blank Исправления для Munin MySQL мониторинга плагин графа не показывается, или оставить пустым

































June 6th, 2006 18:18 6 июня 2006 18:18
[...] Alternatively, on any platform, mysql client can be used to set the new password, althought it’s less secure way of resetting the password (detailed instruction here): [...] [...] Кроме того, на любой платформе, mysql клиент может быть использован для установки нового пароля, хотя он менее безопасный способ сбросить пароль (подробная инструкция здесь): [...]
July 9th, 2006 12:05 9 июля 2006 12:05
I wanna reset my ZXDSL 831 ADSL Modemn Я хочу, чтобы сбросить мой ZXDSL 831 ADSL Modemn
Plz tell me the way how to reset it Почтовый индекс скажите мне, каким образом, чтобы сбросить его
I need to do that right now Мне нужно сделать это прямо сейчас
Best Rgds Best Rgds
dugger(vincitore) dugger (vincitore)
December 19th, 2006 14:54 19 Декабря 2006 14:54
[...] Re: Help me retrieve my password Try this link… Change and Reset MySQL root Password [...] Re: Помогите мне найти мой пароль Попробуйте эту ссылку… Перемены и MySQL Сброс пароля
April 23rd, 2007 08:23 23 апреля 2007 08:23
[...] Change and Reset MySQL root Password » My Digital Life (tags: mysql administration) No Tags Gelesen: 2 / heute: 2 [...] [...] Изменения и MySQL Сброс пароля »Мои Цифровая жизнь (теги: mysql администрирование) нет тегов Gelesen: 2 / сегодня: 2 [...]
May 5th, 2008 16:52 5 мая 2008 16:52
[...] judulnya), setelah googling cuma dapat cara untuk mereset dan mengganti password MySQL di UNIX-like di sini. [...] Judulnya), setelah поиск в Google Чума Ваши cara untuk mereset дан mengganti пароль MySQL ди UNIX-подобных ди здесь. Wah, perlu sedikit modifikasi ni … Berikut cara2 yang saya lakukan: 1. Вах, perlu sedikit изменение ні… Berikut cara2 ян я lakukan: 1. Kill proses MySQL [...] Остановить процесс MySQL [...]
July 3rd, 2008 05:46 3 июля 2008 05:46
On ubuntu, command is mysqld_safe –-skip-grant-tables & В убунту, команда mysqld_safe - пропустите-грант-таблиц и
Extra dash is required so mysql can parse it correctly. Экстра тире, с тем mysql можно разобрать это правильно.