Home > Database > Mysql Tutorial > How to Reset the MySQL Root Password on FreeBSD?

How to Reset the MySQL Root Password on FreeBSD?

Patricia Arquette
Release: 2024-12-09 02:59:14
Original
684 people have browsed it

How to Reset the MySQL Root Password on FreeBSD?

Resetting MySQL Root Password on FreeBSD

Accessing your MySQL database with PhpMyAdmin can be hindered if you have accidentally deleted user accounts. The common solution to reset the root password through SQL doesn't work in some cases.

Solution:

  1. Stop MySQL: sudo stop mysql
  2. Start MySQL in safe mode: sudo mysqld --skip-grant-tables --skip-networking
  3. Connect to MySQL: mysql
  4. Reset the root password: update mysql.user set password = password('your_new_password') where user = 'root';
  5. Flush privileges: flush privileges;
  6. Exit MySQL: exit;
  7. Shutdown MySQL: sudo mysqladmin shutdown
  8. Start MySQL: sudo start mysql

Following these steps should allow you to successfully reset your MySQL root password on FreeBSD 8.1.

The above is the detailed content of How to Reset the MySQL Root Password on FreeBSD?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template