0

I want to setup replication in MySQL on Win10 machines. With the help from this forum I finally managed to start the mysql-service from the PowerShell. To configure the master I have to stop the mysql service. The MySQL-Reference shows this:

C:> "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqladmin" -u root shutdown

Having MySQL Server 5.7 and the default path my line in the Powershell is this:

PS C:> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqladmin" -u root shutdown

But I get “unexpected token -u” and “ unexpected token root”. (As soon as I type quotation mark after the angle bracket the bracket turns red…) – a path in quotes? What is wrong?

Next question I will run in is: Where are the below lines meant to go? In the PowerShell (still on Windows level) they cause errors. Are they accepted as soon as the mysql-service has been shut down?

[mysqld]

log-bin=mysql-bin

server-id=1

Would be great to get help again! Thanks

rlinner
  • 51
  • 5

1 Answers1

1
& 'C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqladmin' -u root shutdown

Also, check out How to run an EXE file in PowerShell with parameters with spaces and quotes

But, why not just Stop-Service "MySQL"?

Pink
  • 48
  • 11
  • It says: "a service named 'MySQL' could not be found" (this is translated). However "Stop-Service" seems to be accepted, but how else could the service be called? I did not rename the service and the default name should be "MySQL". I also tried "net stop MySQL", but get "invalid name of service". But MySQL has been running for 6 months quite smoothly... Anyway, thanks Pink! – rlinner Sep 12 '18 at 15:14
  • It may have a different "Name" and "DisplayName". try Get-Service , look at the entire list, look for MySql and see what's in the "Name" column. – Pink Sep 14 '18 at 18:28
  • Sorry for being so late! You were right: the service is called "MySQL57". I will upvote your answer. Thanks again! – rlinner Sep 19 '18 at 16:03