MySQL 8.0 Server要求Microsoft Visual C ++ 2015 Redistributable Package在Windows平台上运行。在安装服务器之前,请确保已在系统上安装该软件包。下载地址:Microsoft下载中心

选择版本:

  • 解压,并配置环境变量

桌面选中我的电脑右键–>属性–>高级系统设置–>环境变量–>Path–>编辑–>新建

  • 在解压目录下新建my.ini配置文件:
[mysqld]
# 设置3306端口
port=3306
# 设置mysql的安装目录
basedir=D:/Program Files/mysql-8.0.17-winx64
# 设置mysql数据库的数据的存放目录
datadir=D:/ProgramData/MySQL/MySQL8/Data
# 允许最大连接数
max_connections=200
# 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统
max_connect_errors=10
# 服务端使用的字符集默认为UTF8
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
# 默认使用“mysql_native_password”插件认证
default_authentication_plugin=mysql_native_password
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[client]
# 设置mysql客户端连接服务端时默认使用的端口
port=3306
default-character-set=utf8

basedir和datadir按照实际情况填写

  • 安装MySQL

以管理员身份运行cmd
执行

mysqld install

Mysql初始化

mysqld --initialize --console

启动MySQL服务

net start mysql

登录mysql

mysql -u root -p
  • 配置MySQL用户

修改用户密码

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';

创建用户:

CREATE USER 'abc'@'%' IDENTIFIED WITH mysql_native_password BY 'abc';

检查用户

select user, host, plugin, authentication_string from user;

授权远程数据库

GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON *.* TO 'abc'@'%';

查看用户权限

show grants for 'abc'@'%';
win10安装mysql8
Tagged on:     

9 thoughts on “win10安装mysql8

  • 2020年3月16日 at 03:39
    Permalink

    I’ve been browsing online more than three
    hours today, yet I never found any interesting article like
    yours. It’s pretty worth enough for me. Personally, if all website owners and bloggers made good content
    as you did, the net will be much more useful than ever before.

    Reply
  • 2020年4月17日 at 18:19
    Permalink

    Hey there, You’ve done an excellent job. I’ll definitely digg it and personally recommend to my friends.
    I’m sure they’ll be benefited from this site.

    P.S. If you have a minute, would love your feedback on my new website re-design. You
    can find it by searching for “royal cbd” – no sweat
    if you can’t.

    Keep up the good work!

    Reply
  • 2020年5月24日 at 18:36
    Permalink

    I’m not sure where you’re getting your info, but good topic.

    I needs to spend some time learning much more or understanding more.
    Thanks for wonderful info I was looking for this info for my
    mission.

    Reply
  • 2020年7月19日 at 08:19
    Permalink

    I was very happy to search out this web-site.I wanted to thanks on your time for this excellent read!! I definitely having fun with each little bit of it and I have you bookmarked to take a look at new stuff you weblog post.

    Reply
  • 2020年7月31日 at 04:50
    Permalink

    Hey There. I found your blog using msn. This is an extremely well written article.

    I’ll make sure to bookmark it and come back to read more of your useful
    information. Thanks for the post. I will certainly comeback.

    Reply
  • 2020年8月10日 at 05:28
    Permalink

    It’s a shame you don’t have a donate button! I’d without a doubt donate to this superb blog!

    I guess for now i’ll settle for book-marking and adding your RSS feed to my Google account.
    I look forward to fresh updates and will talk about this site
    with my Facebook group. Talk soon!

    Reply
  • 2020年8月10日 at 07:19
    Permalink

    Howdy! I simply would like to give a huge thumbs up for the nice information you’ve got right here on this post. I can be coming again to your weblog for more soon.

    Reply

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注