Database / MySQL Installation

Database / MySQL Installation

mysql installation, start-up and basic configuration - windows version

1. Download

Step one: Open URL, https://www.mysql.com, click after the jump to https://www.mysql.com/downloads downloads

Step two: Go to the URL https://dev.mysql.com/downloads/, select Options Community

Step 3: Click MySQL Community Server enter https://dev.mysql.com/downloads/mysql/ page, then click the 5.6 version of the database

Step four: windows operating system version 5.6 after the click will jump to https://dev.mysql.com/downloads/mysql/5.6.html#downloads URL, the page as shown below, to download the good version and operating system, click Download

Step five: you can not log in or register, simply click No thanks, just start my download can be downloaded.

2. Extract

Unzip the downloaded zip file, unzip the file after the folder into any directory, this directory is mysql installation directory (the best is the root directory, so easy to find).

3. Configuration

Open Directory, you will see my-default.ini configuration file, copy the configuration file can be renamed my.ini or my.cnf (or create a new file after himself, renamed my.ini, in modifying the configuration file, use Notepad ++ or Pycharm open).

[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8 
[mysqld]
#设置3306端口
port = 3306 
# 设置mysql的安装目录
basedir=C:\Program Files\mysql-5.6.39-winx64 
# 设置mysql数据库的数据的存放目录
datadir=C:\Program Files\mysql-5.6.39-winx64\data 
# 允许最大连接数
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB

4. Environment Variables

In the rear of the system PATH variable to add: the path (such as C your mysql bin folder: \ mysql-5.6.41-winx64 \ bin

5. Install the MySQL service

Open an administrator cmd window, change the directory to the bin directory where you extracted the file, enter a carriage return run mysqld install

6. Start mysql service

Enter an administrator in cmd: net start mysql

服务启动成功之后,就可以登录了,输入mysql -u root -p(第一次登录没有密码,直接按回车过)
net stop mysql # 停止mysql

#在windows操作系统上没有重启mysql服务的命令
#如果要重启服务,只能先stop再start

Guess you like

Origin www.cnblogs.com/liubing8/p/11431382.html