I installed MySQL on Microsoft Windows 8 Using a noinstall Zip Archive. But when i tested by executing the following commands on windows prompt, the above error showed up.<
If you're using the no install zip, you need to execute mysqld.exe
first to start the service, and then execute mysql.exe
to open your connection.
The no install is nice, but if you intend to do any serious work with MySQL, you may want to consider either using the MSI to do a proper installation, or if you're doing web development work give XAMPP a try.
I had a problem with most of these solutions . The fact that I couldn't find the bin folder in my c drive. I tried solution offered here " https://www.howtosolutions.net/2017/08/fixing-mysql-10061-error-after-migration-of-database-files/ "and vwala "welcome to the mysql monitor ...."
Despite that my server was running, I had the same problem. I found out that it was the port. So you need to specify the port:
mysql -u user -p --port 0000
The port on your machine may be different. To find out on which port mysql is running open the mysql ini file and look for port=
. A port often used is 3306
.
Example how to log on to mysql
mysql -u root -p --port 3306
First of all, you need to ensure the port number on which the server is running. Then you can run
mysql -u username -p --port portNumber
on the command line
In my case I have 2 different version of mysql in Windows OS and I solved the my problem by bottom step:
first stop all mysql service.
I create one config file in C:\mysqldata.cnf with bottom data(my mysql is in "C:/mysql-5.0.96-winx64" directory ):
[mysqld]
datadir = C:/mysql-5.0.96-winx64/data
port = 3307
then I run bottom command in cmd:
C:\mysql-5.0.96-winx64\bin\mysqld --defaults-file=C:\mysqldata.cnf --console
above step reference
then I create txt file in C:\resetpass.txt with bottom data:
UPDATE mysql.user SET password=PASSWORD('ttt') WHERE user='root';
then run mysqld with bottom command:
C:\mysql-5.0.96-winx64\bin\mysqld --init-file=C:\resetpass.txt --install mysql2 --console
net start mysql2
after these step you have one mysql service(with name mysql2) than run with port 3307.
I have 2 version of mysql with different user management tables(in version 5.0.96 user table difference with 5.5 version because of that I must be change table folder in first step)
you can run other mysql service with other port now(and you can run this steps with different datadir, service name and port for it again)
The solution that worked for me is:
cd C:\Program Files\mysql-8.0.22\mysql-8.0.22-winx64\bin
mysqld -install
(Service successfully installed)mysqld --initialize
(no prompt)Let me know if it helps!