• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
LLODO – News – Tech and Education

LLODO - News - Tech and Education

Breaking News, Latest News about education, Technoly

  • News Tech
  • World News
  • Education
  • Science
You are here: Home / Applications / Students question – How to Reset MySQL Root Password?

Students question – How to Reset MySQL Root Password?

04/21/2019 by admin

MySQL root account is very critical. Without it the root user won’t be allowed to access or mange MySQL databases. This brief tutorial shows students and new users steps to reset the root password of MySQL database server.

Losing the root password for your MySQL database server is a show stopper.  You won’t be able to access or manage the server as all. You’ll have to find a way to reset that lost password or you’re out for good.

This brief tutorial shows students how to easily reset forgotten MySQL root password.

Step 1: Step MySQL server

The first step in this process is to stop MySQL server. You won’t be able to reset MySQL root password while the server is running. You need to temporarily stop it by running the commands below.

Ubuntu: sudo systemctl stop mysql
Other systems: sudo systemctl stop mysqld

Step 2: Start MySQL server in safe-mode to bypass security protocols

Next, start MySQL server with the options to skip-grant-tables. In this mode, you will be able to login to the default MySQL database and create a new password for the root user.

To do that, run the commands below.

sudo mysqld_safe --skip-grant-tables &

Step 3: Login to MySQL database

Next, login to MySQL database server into MySQL default database. To do that, run the commands below.

mysql -u root mysql

Step 4: Create a New root password

Finally, run the SQL statements below to create a new password for the root user.

UPDATE USER SET authentication_string=password('new_password_here') WHERE USER='root';

FLUSH PRIVILEGES;

exit;

After that, restart MySQL server and you should be good.

sudo systemctl restart mysql

Now you should be able to logon to MySQL server using the new password. Hope this helps and please come back if you like this.

Enjoy!

 

Related posts:

  1. Installing MySQL Latest Versions on Ubuntu 17.04
  2. How to Install the Latest MySQL 5.7 on Ubuntu 17.04
  3. Install MySQL 8.0 on Ubuntu 16.04 / 17.10 / 18.04
  4. Resetting MySQL Root Password on Ubuntu 16.04 / 17.10 and 18.04 LTS
  5. MySQL Server 8.0.14 Released — Here’s How to Install / Upgrade on Ubuntu 16.04 / 18.04
  6. Today’s Lesson: How To Install MySQL Server on Ubuntu
  7. How do You Install MySQL on Ubuntu
  8. Managing MySQL Databases via phpMyAdmin on Ubuntu?
  9. Student Question – How Do You Optimize and Repair MySQL Databases?

Filed Under: Applications, Technology Tagged With: MySQL Server

Primary Sidebar

Featured Posts

[LLODO] Seattle mass shooting leaves at least three people – including toddler – injured, police hunt for gunman

04/12/2021

[LLODO]

04/12/2021

[LLODO] This Day in History: April 12

04/12/2021

[LLODO] California city erects fence outside COVID mandate-defying restaurant in Burbank

04/12/2021

[LLODO] Jordan blasts Biden administration policy preventing media access to migrant facilities

04/12/2021

Categories

  • Applications (750)
  • Business (6,322)
  • Education (3,351)
  • Health (4,182)
  • Iphone (2,005)
  • News Tech (11,826)
  • Reviews (6,041)
  • Science (2,032)
  • Technology (13,615)
  • World News (3,344)

Home - About Us - Privacy Policy - Contact Us - Site map
Copyright © 2021 · LLODO.COM - Internet Do - QA Do Eng