• 🏠 Home
  • 🧰 Online Generators
  • 📰 Blog
  • 🔎 Search
  • 📧 Contact
  • 📘 Guestbook
  • 🗞️ News
  • 💰 Support
  • ℹ️ Info: The website has been modernized to improve readability and smartphone compatibility. Feel free to report any bugs using the contact form

    Change a lost MySQL password


    Procédure

      Connect with the root user. Type:
        /etc/init.d/mysql stop
      To stop MySQL server, then launch it, with the following command, to ignore user privileges:
        /usr/sbin/mysqld --skip-grant-tables &
      Enter the following command:
        mysql mysql
      To connect to MySQL database. To change root password, for example, enter:
        update user set password=PASSWORD("my_new_password") where user='root';
      The server returns:
          Query OK, 1 rows affected (0.04 sec)
          Rows matched: 1  Changed: 1  Warnings: 0
      Exit MySQL engine, by typing:
        quit
      We just have, now, to relaunch MySQL in standard mode. Enter:
    killall mysqld
    To kill MySQL process, then enter:
      /etc/init.d/mysql start

    Go Back



    (c) 2005-2025 Jérôme DESMOULINS
    Data privacy