mysql desktop administrator password reset

I am trying to reset the root password for mySQL Workbench since I forgot it. I was looking through some online tutorials on how to do this, and they all talk about the bin folder. I went to the program folder and did not see the bin folder. How to do it?

+4
source share
5 answers

Reset root password The official documentation has cases for Windows and Unix systems, and at the end of the document there is a β€œgeneral” instruction. I hope this helps.

+4
source

Reset MySQL Password Password from PowerShell

1. Stop the MySQL service and process.

spsv mysql* kill -f -Pro mysqld -ErrorA Ignore 

2. Create a temporary initialization file

 ri C:\temp.txt ni -tf C:\temp.txt ac C:\temp.txt "UPDATE mysql.user SET Password=PASSWORD('4321') WHERE User='root';" ac C:\temp.txt "FLUSH PRIVILEGES;" 

3. Get the default MySQL file location.

 $defaultsFile = (gci -r -Path "C:\ProgramData\MySQL" -include my.ini).FullName 

4. Change dir to bin bin.

 cd "C:\Program Files\MySQL\MySQL Server*\bin" 

5. Run mysqld with the password reset.

 & .\mysqld.exe --defaults-file="$defaultsFile" --init-file="C:\\temp.txt" 

6. Kill and restart MySQLD (in the new PowerShell prompt).

 ps mysqld | kill -f sasv "MySql*" 

7. Return to the initial prompt and test

 & .\mysql -u root -p4321 \q 

Notes

  • We cannot do anything until we completely stop MySql.
  • Create this in C:\ , then add the reset password commands; ri deletes any existing temp.txt file.
  • You can get this path through the service control manager or use (gwmi win32_service | ?{$_.Name -like 'mysql*'} | select -First 1).PathName .
  • * the go means we don’t need to know our version number.
  • & forces PowerShell to run exe as on the command line. After starting PowerShell, a hang will appear - this is because it starts the mysqld process.
  • We need to kill in another process because the existing console is busy.
  • Go back to the initial console because it is already in bin . After the test, you should see mysql> . Use \q to exit.

see also

http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

+2
source

I am just starting to learn MySQL, I am running 5.7.20 on Mac OS 10.12 when I tried to use the following command in terminal

mysql> UPDATE mysql.user SET authentication_string = PASSWORD ('password')

i keep getting

-bash: syntax error next to unexpected token '('

Can someone help me with this error message? I have tried many different websites, no one seems to have an answer to this.

0
source

Hey, if you're on Windows 7 like me, you will find the MySQL executable files here: C: \ Program Files \ MySQL \ MySQL Server 5.5 \ bin. I used mysqld.exe because mysqld-nt.exe no longer exists in newer versions of MySQL.

After following the instructions in the documentation, you should have the same command: C: \ Program Files \ MySQL \ MySQL Server 5.5 \ bin> mysqld.exe --defaults-file = "C: \ Program Files \ MySQL \ MySQL Server 5.5 \ my -medium.ini "--init-file = C: \ MySQL-initRootPass.txt

Note. Make sure you run CMD.exe as an administrator. For the most part this has been fixed for me.

-1
source

You must reset the password! steps for mac osx (tested and working) and ubuntu

Stop MySQL

 $ sudo /usr/local/mysql/support-files/mysql.server stop 

Run it in safe mode:

 $ sudo mysqld_safe --skip-grant-tables 

(above line is the whole command)

This will be the current command until the process completes, so open another shell / terminal window, log in without a password:

 $ mysql -u root mysql> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root'; mysql> flush privileges; mysql> exit; 

For the version of Mysql (mysql Ver 14.14 Distrib. 5.7.19) -

Try the syntax as the mysql user table has been updated a bit.

 sudo mysqld_safe --skip-grant-tables mysql> UPDATE mysql.user SET authentication_string = PASSWORD('password') WHERE User = 'root' AND Host = 'localhost'; mysql> FLUSH PRIVILEGES; sudo /usr/local/mysql/support-files/mysql.server start 

your new password is "password".

-1
source

Source: https://habr.com/ru/post/1382553/


All Articles