Install mysql5 7. Install / Remove of the Service denied! That's why

Big data learning monk 2022-02-13 07:18:40 阅读数:145

install mysql5 mysql install remove

stay w10 New installation of system mysql service , Some problems

ERROR 2003(HY000):Can’t connect to Mysql server on ‘localhost’ (10061)
The mistake is mysql The service did not start

cmd Input in net start mysql

 Tips : Invalid service name Please type the NET HELPING 2185 To get more help

The reason is that there is no registration in the system mysql Into the service . That is, there is no mysql service , We need to mysql Add services to computer services

Then how will Mysql Sign up to win Go inside the service ?
The procedure is :

1. Enter into mysql Installation directory bin Under the table of contents
D:\mysql-5.7.17-winx64\bin> mysqld --install, enter ,
D:\mysql-5.7.17-winx64\bin>mysqld --initialize

Tips :Service successfully installed, On behalf of the successful registration service .
If you make a mistake :

Install/Remove of the Service Denied

Then open cmd.exe Program time selection “ Open as administrator ”.
2. Repeat steps above
Final tip :

D:\mysql-5.7.17-winx64\bin>mysqld --install
Service successfully installed.

will mysql The service has been added to the native service
Input again :net start mysql

MySQL The service is starting .
MySQL Service started successfully .

Be accomplished !
Finally remember to set up mysql The service starts automatically ~

open [ Control panel - Management tools - service ]
View service "MySql " The startup type of is auto

Windows Install the decompressed version MySQL Installation steps

Environment variable location reference :JDK Environment variable configuration

stay ” Variable name “ Fill in ”MYSQL_HOME

” A variable's value “ by JDK The installation path , The author's path is ”D:\mysql-5.7.17-winx64

Click on ” determine “ Options

 Insert picture description here
stay ” System variables “ Find ”Path“
 Insert picture description here

Choose ”Path“ Click on ” edit “ Options

Choose... On the right “ Edit text ”, Copy everything in quotation marks %MYSQL_HOME%\bin;, To “ A variable's value ” At the top of the column ,“ determine ”
 Insert picture description here

2. take MySQL Add to the system service and start :

1) Right click “ Start ”——> “ function ” Or shortcut key :“ Start ”+“R”( Run as administrator cmd)

2)cd To MySQL Of the local disk path bin Catalog , And then go back :
perform :mysqld install MySQL --defaults-file="D:\apps\mysql\mysql-5.7.17-winx64\my-default.ini( The location of the actual decompression )

start-up mysql service :net start mysql
This will bring up MySQL Service failed to start , The service did not report any errors .
terms of settlement :
perform :

mysqld --install
mysqld --initialize
net start mysql

④ modify mysql password
Mysql A default password will be initialized after startup , The password is in mysql Installation directory data/xxx.err In the closing document .
 Insert picture description here
 Insert picture description here
stay cmd perform :mysql -uroot -p
Enter the password in the file above :XXXXXX
Change Password , perform :SET PASSWORD = PASSWORD(‘ The password you want to set ’);
Quit using the new password XXX Sign in .

copyright:author[Big data learning monk],Please bring the original link to reprint, thank you.