Install mysql database zip version | mysql & zip

When just getting started with mysql, the installations and with great effort, a lot of online tutorials may be because of different versions can not fully correspond on a patchwork of various disorders, afraid of the future when the need to install again forget, now finishing as follows:

(As to why a zip version, msi steps are feeling better, you might as well use zip)

The steps outlined below:

Unzip -> Environment Variables -> my.ini Configuration -> c ++ package installation -> mysqld --initialize --console -> wait password

-> mysqld --install     -> mysql NET Start     -> mysql -u root -p     -> password     -> successfully entered the mysql

-> exit // Exit mysql

-> net stop mysql // shut down mysql service

-> mysqld --remove // ​​delete mysql

Delete data files can then be re-mounting operation command line

1. Download unzip

Download URL: https://dev.mysql.com/downloads/mysql/

After downloading unpack:

 

 

 

2. environment variable configuration

Right-click Computer -> Properties -> Advanced System Settings on the left -> "Advanced" tab -> Environment Variables

(Win7 version of the environment variable as shown)

 

 

 Configure the system environment variables above mysql (personal habits set in the user variables)

3.my.ini Configuration

New txt back to extract the directory and renamed my.ini (format to .ini format) and enter the following:

[mysql]

# Mysql client to set the default character set

default-character-set=utf8 
[mysqld]

#设置3306端口

port = 3306 

# 设置mysql的安装目录     !!!需要自行更改
basedir
=D:\mysql-8.0.11-winx64
# 设置mysql数据库的数据的存放目录 !!!需要自行更改
# datadir
==D:\mysql-8.0.11-winx64\data # 允许最大连接数 max_connections=200 # 服务端使用的字符集默认为8比特编码的latin1字符集 character-set-server=utf8 # 创建新表时将使用的默认存储引擎 default-storage-engine=INNODB

 

4.c++文件包安装

配置完成后本应该可以的了,但是在命令行操作时出现了缺少.dll文件,这个可以通过安装vsc++的运行库(vs2013及以上版本安装后会自动下载好或者单单下载插件包)解决

Microsoft Visual C++ 2015 Redistributable参考下载地址:https://www.microsoft.com/zh-cn/download/details.aspx?id=40784

 

 

 

 解压安装

5.接下来基本上都是命令行操作:

左下角开始按钮搜索 cmd 以管理员方式运行!!!

mysqld --initialize --console  等待一会后出现初始密码并且在解压目录下会发现一个data文件夹

mysqld --install  (这一步需要管理员权限,不然会提示安装失败,所以用管理员身份打开cmd)

net start mysql  打开mysql服务,这一步同样需要管理员权限(因为后面关闭服务时也需要)

mysql -u root -p   输入密码

成功 进入mysql

 

 6.修改密码(根据mysql的版本 对应命令不同):

在登陆以后(所以尽量记住原密码)

旧版本:SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');

新版本:ALTER user 'root'@'localhost' IDENTIFIED BY 'MyNewPassword';

Guess you like

Origin www.cnblogs.com/moope/p/12127756.html