Reputation: 65
I tried to start the server from MySQL application that is startup/shutdown there iam getting an error MySQL cannot connect to localhost(10061) code 2003 After that I tried to connect it from cmd line ,but that is also not working
C:\> "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld"
mysqld: Can't change dir to 'C:\Program Files\MySQL\MySQL Server 8.0\data\' (OS errno 2 - No such file or directory)
2018-09-18T07:03:05.833751Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld (mysqld 8.0.12) starting as process 1472
2018-09-18T07:03:05.841119Z 0 [Warning] [MY-010091] [Server] Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\LAPTOP-7VFDP9Q8.lower-test
2018-09-18T07:03:05.841308Z 0 [Warning] [MY-010091] [Server] Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\LAPTOP-7VFDP9Q8.lower-test
2018-09-18T07:03:05.842165Z 0 [ERROR] [MY-010172] [Server] failed to set datadir to C:\Program Files\MySQL\MySQL Server 8.0\data\
2018-09-18T07:03:05.856689Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-09-18T07:03:05.858721Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld: Shutdown complete (mysqld 8.0.12) MySQL Community Server - GPL.
Upvotes: 2
Views: 13296
Reputation: 15
The reason behind this error is that the server is looking for the data directory to create a test file but cannot find one.
If you have installed MySQL workbench then the data folder might not exist at 'C:\Program Files\MySQL\MySQL Server 8.0\'.
First check whether the data folder is at 'C:\Program Files\MySQL\MySQL Server 8.0\' or not. If not, you can copy the data folder from 'C:\Program Files\MySQL\MySQL Workbench 8.0 CE\' and paste it at 'C:\Program Files\MySQL\MySQL Server 8.0\'.
The command will execute without any error!
Upvotes: 0
Reputation: 84
No such file or directory
It's good hint. Check this path 'C:\Program Files\MySQL\MySQL Server 8.0\data\' Maybe it not exists. If it's true - just create folder. If folder already created - check datadir in your my.ini Maybe you need quotes ("")
Upvotes: 5