mysql5.7绿⾊版安装详细(图⽂)教程
mysql5.7绿⾊版安装详细(图⽂)教程
⼀.MySQL镜像国内下载地址
打开页⾯后可以看到mysql各版本的镜像,以mysql-5.7为例⼦进⾏下载安装
打开页⾯后使⽤快捷键Ctrl+F,快速定位到需要下载的内容,例:winx64
⼆.解压与安装
1.解压下载好的压缩包
解压后得到:
2.在解压得到到⽂件夹中新建⼀个my.ini⽂件
解压后的mysql根⽬录下没有my.ini⽂件,⾃⼰去⽹上⼀份就可或者使⽤我在后⾯给出的代码。.ini⽂件会在初始化mysql中⽤到
# For advice on how to change settings please see
# http=//sql/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# ***default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[client]
port =3306
default-character-set = utf8
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option= logging
# changes to the binary log between backups.
# log_bin
port =3306
# These are commonly set, remove the # and set as required.
basedir="D:\...\mysql"
datadir="D:\...\mysql/data/"
# server_id = .....
character_set_server = utf8
mysql下载要钱吗
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
3、修改ini配置⽂件中的安装⽬录和数据存放⽬录修改为mysql⽂件的路径
#设置mysql的安装⽬录
basedir=D:\MySQL
#设置mysql数据库的数据的存放⽬录
datadir=D:\MySQL\data
4、打开cmd,初始化数据库
mysqld --initialize
初始化完成后,mysqld根⽬录下会⾃动新增data⽂件夹
打开data⽂件夹,到.err后缀⽂本打开
到⽂件password位置,红⾊框中为数据库初始化密码,后续修改初始化密码使⽤
5、安装数据库
mysqld --install
6、启动服务
net start mysql
7.关闭Mysql服务
net stop mysql
8.修改初始密码
登录
mysql -uroot -p'你的初始密码,步骤4中红框⾥的字符'
修改密码为root
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
9.MySQL服务卸载
服务卸载
net stop mysql
mysqld --remove

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。