j-dimension
j-dimension

Reputation: 185

MySQLInstallerConsole not setting root password?

I am installing MySQL on Windows with the following command line:

MySQLInstallerConsole community install -silent server;5.7.12;x64:*:type=config;servertype=Server;openfirewall=true;generallog=true;serverid=3306;enable_tcpip=true;port=3306;rootpasswd=%1;installdir="C:\MySQL\MySQLServer-5.7":type=user;username=foo;password=bar;role=DBManager

This line is contained in a script, and I pass in the root password from a random generated string. However, I am getting an access denied for 'root'@'localhost' when trying to access the server via

mysql -u root -p

(and providing the password)

I can not find any issues with the parameters for MySQLInstallerConsole. Connecting as user foo even works, but I really need the root password to work.

Any ideas?

Upvotes: 3

Views: 714

Answers (1)

j-dimension
j-dimension

Reputation: 185

I finally figured out what the issue was: the system had a MySQL server installed before. The service and binaries had all been removed, but there still was a MySQL data directory in the default location (somewhere in %ProgramData%"). This seems to cause to make the installer console fail to finish the new installation WITH a different root password.

Removing the old data directory and re-running the installer command line as stated in the original question (without any changes) resulted in successful installation.

Upvotes: 2

Related Questions