Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save flayder/5dcc3e8191964a7e1b6c9bf0db141473 to your computer and use it in GitHub Desktop.

Select an option

Save flayder/5dcc3e8191964a7e1b6c9bf0db141473 to your computer and use it in GitHub Desktop.
если пароля не было до этого
mysqladmin -u root password '1234'
если пароль был.
Останавливаем MySQL:
/etc/init.d/mysql stop
Запускаем в режиме без проверки прав доступа:
/usr/sbin/mysqld --skip-grant-tables &
Соединяемся как root без пароля:
mysql
Выбираем активную БД:
use mysql;
Обновляем пароль:
mysql> update user set Password=PASSWORD('новый пароль') WHERE User='root';
mysql> flush privileges;
Завершаем работу mysqld:
fg
"Ctrl+c"
Запускаем MySQL в обычном режиме.
/etc/init.d/mysql star
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment