mysql5.7 green version of the configuration and can not find the mysql service issues resolved

First, download software

1. Go to the official website mysql, Oracle log onto their account (not your own account registered a), download Mysql-5.7.17, download address: http: //dev.mysql.com/downloads/mysql/

2. unzip the downloaded file to the specified directory, unzip E: /mysql-5.7.17-winx64

Second, the installation process

1. Assign the environment variable path, the E: /mysql-5.7.17-winx64/bin configuration to its own path in

Environment Variables

MySql_HOME===================E:/mysql-5.7.17

Path =========================%MySql_HOME%/bin;

2. Copy my-default.ini under decompression path, change the name as shown below my.ini

3. Open the file my.ini, add the following:

#########################################################

[client]

default-character-set=utf8

[mysqld]

basedir=E:/mysql-5.7.17

datadir=E:/mysql-5.7.17/data

port = 3306

character-set-server=utf8

#########################################################

4. Then my.ini file into the bin directory (the beginning, I was placed in the root directory of the initialization data to back when the folder has not initialized)

Third, initialize the database, configuration information

 

1. Run as administrator windows command line (Special note: WIN7 WIN7 or later and must use this system administrator, or follow-up operation to be wrong)

 

2. Go to the directory where you unzipped mysql D: /mysql-5.7.15-winx64/bin (Reminder: Here you need to go to the bin directory, or subsequent operations error)

 

3.注册Mysql服务,运行命令:mysqld --install MySQL  (这一步很重要,当你发现自己的mysql服务没有启动的时候,可以执行这一步看看,)

 

如果出现:"Service successfully installed.“提示,证明成功安装mysql服务

 

4.初始化data目录

 

输入命令:mysqld --initialize-insecure (生成无密码的root用户)

 

此时在mysql文件夹下会生成一个data文件夹,里面有些文件夹和文件,这样就表明初始化成功了

 

5.初始化完成后启动mysql服

 

输入命令:net start mysql

 

出现MYSQL服务已经启动成功就表示OK

 

6.设置密码

 

mysqladmin -u root password 密码

 

7.开始使用mysql

 

输入命令:mysql -u root -p

 

然后输入刚才设置的密码

 

四、移除

 

1.如果是移除已安装好正在使用的mysql,

则需要先在cmd里面进入到mysql解压目录下的bin目录下,

命令行中输入net stop mysql关闭MySQL服务,

然后运行命令 mysqld --remove

Guess you like

Origin www.cnblogs.com/vhviqd/p/11374021.html