欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

mysql 5.7.13 winx64安装配置方法图文教程(win10)

程序员文章站 2023-12-12 20:17:34
本文实例为大家分享了mysql 5.7.13 winx64安装配置方法图文教程,供大家参考,具体内容如下 下载 地址: 安装 1、解压下载好的mysql-5.7.1...

本文实例为大家分享了mysql 5.7.13 winx64安装配置方法图文教程,供大家参考,具体内容如下

下载

地址:

安装

1、解压下载好的mysql-5.7.13-winx64.zip到你需要安转的目录(eg:d:\mysql);

2、配置解压目录下的my_default.ini中命名为my.ini

作相关的配置如下:

# these are commonly set, remove the # and set as required.
basedir = d:\mysql5.7(mysql安装目录)
datadir = d:\mysql5.7\data(mysq中数据的保存目录,自己定)
port = 3306(mysq的端口号)
# server_id = .....

3、添加环境变量

将d:\mysql5.7\bin添加到环境变量之中;

eg:......;d:\mysql5.7\bin

4、初始化

进入mysql的bin文件夹
mysqld –install
mysqld –initialize –console
(有一个 root@localhost: 后面有一连串的字母数字符号, 这是 mysql 为你自动生成的随机密码,一定要记下来, 一会我们登陆 mysql 数据库的时候要用)。
ps:使用-initialize生成随机密码,使用-initialize-insecure生成空密码,初始化后data文件夹会自动生成,不用自己新建哦。

5、启动mysql

net start mysql

6、进入msyql并设置密码

d:\mysql5.7\bin>mysql -u root -p
enter password:
welcome to the mysql monitor. commands end with ; or \g.
your mysql connection id is 2
server version: 5.7.13 mysql community server (gpl)

copyright (c) 2000, 2016, oracle and/or its affiliates. all rights reserved.

oracle is a registered trademark of oracle corporation and/or its
affiliates. other names may be trademarks of their respective

owners.

type 'help;' or '\h' for help. type '\c' to clear the current input statement.

mysql> set password=password('你自己的密码');
query ok, 0 rows affected, 1 warning (0.00 sec)

mysql>

连接到远程的mysql(两台win7局域网之间的连接mysql)

连接中的错误:

1、错误描述:设置root的远程权限时:error 1062 (23000): duplicate entry ‘%-root' for key ‘primary'(最好不用这个,使用使用下面的的方法授权)。
解决办法:已经设置成功了。

2、mysql中的授权:

mysql> grant all privileges on . to ‘root'@'%' identified by ‘密码' with grant option; 
mysql> flush privileges; 

3、关闭防火墙(同时注意作为mysql载体的win7的ip地址的正确性局域网ip)

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。

上一篇:

下一篇: