Saturday, January 12, 2019

Run MySQL without Administrator privileges

Create a text file containing the password-assignment statement on a single line. Replace the password with the password that you want to use.

ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

Save the file. This example assumes that you name the file C:\mysql-init.txt

Open a console window to get to the command prompt: From the Start menu, select Run, then enter cmd as the command to be run.

Start the MySQL server with the special --init-file option (notice that the backslash in the option value is doubled):

cd "C:\Program Files\MySQL\MySQL Server 8.0\bin"
mysqld --init-file=C:\\mysql-init.txt