360SDN.COM

首页/MySQL/列表

MySQL8.0.11解压版mysql-8.0.11-winx64.zip安装配置教程,修改root密码,连navicat

来源:  2018-07-17 14:01:37    评论:0点击:

一、下载MySQL 8.0.11 和vc_redist.x64.exe

MySQL需要Microsoft Visual C++ 2015 Redistributable Package ,首先从微软官网下载vc_redist.x64.exe
从MySQL官方网站mysql.com找到MySQL Community Server 8.0.11的下载地址:这里,在这里可以选择操作系统平台。这里选择的是 Microsoft Windows平台。下面有三个可选的下载文件,
第一个是MySQL Installer 5.6 for Windows,这将下载下来一个.msi可执行安装文件。
另外有两个解压版(Zip版)分别是Windows (x86, 64-bit), ZIP Archive 和 Windows (x86, 32-bit), ZIP Archive。下载下来,分别是mysql-8.0.11-winx64.zip 和 mysql-8.0.11-win32.zip。



官方下载地址:
https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.11-winx64.zip
 

二、安装MySQL 8.0.11

下载的zip包有183.3MB,下载了几分钟就好了。

1、将mysql-8.0.11-winx64.zip 解压到D:\mysql\目录。

2、创建my.ini作为MySQL的配置文件

好了,这样一个基本的MySQL环境所需要的参数就够了。

[WinMySQLadmin]  

Server = D:/mysql/bin/mysqld.exe
[mysql]

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

#query_cache_type=1
#query_cache_size=256M
# 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 =5524M
key_buffer_size=1570912
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir =D:/mysql
# datadir =D:/mysql/data
# port =3306
# server_id = .....
# The TCP/IP Port the MySQL Server will listen on
port=3308
max_connections=500
#innodb_force_recovery=1 
#Path to installation directory. All paths are usually resolved relative to this.
basedir="d:\\mysql" 
#Path to the database root
datadir="d:\\mysql\\data"
max_allowed_packet=32M
# The default character set that will be used when a new schema or table is
# created and no character set is defined
character-set-server=utf8
join_buffer_size = 512M
sort_buffer_size = 4M
read_rnd_buffer_size = 4M 
# The default storage engine that will be used when create new tables when
default-storage-engine=INNODB


注意这里windows平台
[mysqld]
# set basedir to your installation path
basedir=E:\\mysql
# set datadir to the location of your data directory
datadir=E:\\mydata\\data


3、初始化MySQL数据库
方式一:
命令:mysqld –initialize-insecure
或者 mysqld --defaults-file=d:\mysql8\my.ini –initialize-insecure

作用:初始化数据库,并设置默认root密码为空



方式二:
命令:mysqld –initialize
或者 mysqld --defaults-file=d:\mysql8\my.ini --initialize

作用:初始化数据库,并设置默认root密码为过期的随机密码

下图所示的内容为随机生成的密码:





4、为Windows系统安装MySQL服务
命令:mysqld install
作用:为Windows系统安装MySQL服务,默认服务名为:mysql
这里写图片描述


命令启动mysql8.0

mysqld --defaults-file=d:\mysql8\my.ini --console
 

更改mysql8.0的root用户密码:

 ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Root@123';
flush privileges;
mysql8.0以上密码策略限制必须要大小写加数字特殊符号,我之前用mysqladmin,set,update,参考修改root密码的前人:http://www.cnblogs.com/liufei88866/p/5619215.html


 

二,mysql8.0与Navicat的的连接

还是上面的一样,步骤以文字的形式描述:

1.登录MySQL,mysql  --port 3306  -u root -p 

2.更改加密方式,

ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;


 

3.更改密码,

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

4.刷新提交事务,

FLUSH PRIVILEGES;
5.重新登录,验证更改的密码是否生效。



 

为您推荐

友情链接 |九搜汽车网 |手机ok生活信息网|ok生活信息网|ok微生活
 Powered by www.360SDN.COM   京ICP备11022651号-4 © 2012-2016 版权