I am trying to connect the MySQL server (mysql-5.7.23) from command prompt using the command mysql -u root
it throws an error ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
.
I am using Windows 10.
I have followed following steps :
- Unzip the mysql-5.7.23 file and put on C drive.
- Add the
data
folder in the installation directory and also add the my.ini
- Went to the
bin
folder in command prompt and executed mysqld --initialize-insecure
, it generated some file in the data
folder.
- Then I added the mysql path environment variable.
- After that I started MySQL service. It is running properly.
- Again in the command prompt, I have executed
mysqld --install
, it shows service already exists.
- But when I tried to connect to the server, it throws an error,
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
I have tried all solutions from ERROR 2003 (HY000): Can't connect to MySQL server on localhost (10061)
, but still it is not working.
Am I missing something?
Edit : One more observation, when I execute mysqld
, the cursor in the command prompt return to again current directory, which I think is not expected behavior.