I can't run MySQL.exe in interactive mode in Powershell on a Nano Server installation. I have initialized the data folder with mysqld.exe --initialize. The password is output to the file C:\Program Files\MySQL\MySQL Server 5.7\data\ServerName.err.

I type the command: mysql.exe -u root -ppassword, where I enter the randomly-generated password.

If the password is correct, I get:

mysql.exe : mysql: [Warning] Using a password on the command line interface can be insecure.

And then it returns me to the prompt.

If I do not specify a password when using -p or --password, the client program is supposed to solicit the password interactively. When I try that, I don't get any prompt, nothing written to the console, and when I press CTRL-C, I get:

The remote pipeline has been stopped.

Are these executables capable of being run under a Powershell remote session? Is there something wrong with the way I'm trying to use the console? Maybe this a problem with my Powershell configuration?

Update: After deleting and reinitializing the data folder, I keep getting Access denied for user 'ser=root'@'localhost' (using password: YES) when I enter the randomly generated password using the following command: & mysql –user=root –password=(password). I have also tried to change the password using a text file with ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; in it, but when I do that, I have to press CTRL-C to return to the prompt, as stated previously. Looking at the error log, MySQL claims to have processed the text file, but I still can't logon.


You don't say explicitly which PowerShell host you are using. You might be using PowerShell ISE, as per: How to access Nano Server

If you are using PowerShell ISE this (using mysql.exe interactively) probably won't work, as powershell_ise.exe doesn't support interactive tools in the same way that plain old powershell.exe does. This is discussed a little on the following Stack Overflow question:

In this case, try powershell.exe instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.