MySQL是一个关系型数据库管理系统,由瑞典MySQL AB 公司开发,属于 Oracle 旗下产品。MySQL 是最流行的关系型数据库管理系统之一,使用 C和 C++编写,并使用了多种编译器进行测试,保证了源代码的可移植性。
一、下载安装包
https://dev.mysql.com/downloads/mysql/
选择安装包(安装版或者解压免安装版)这里选择了zip压缩版
二、解压
这里选择了解压到了D盘(D:\mysql-5.6.32-winx64)
三、修改配置文件
配置文件为my.ini 解压文件里有一个my-default.ini文件默认的新建一个my.ini文件根据需要配置
[mysqld]
# Remove leading # and set to the amount ofRAM for the most important data
# cache in MySQL. Start at 70% of total RAMfor dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a veryimportant data integrity option: logging
# changes to the binary log betweenbackups.
# log_bin
# These are commonly set, remove the # andset as required.
# basedir = .....
basedir ="D:\mysql-5.6.32-winx64"
# datadir = .....
datadir="D:\mysql-5.6.32-winx64\data"
# port = .....
# server_id = .....
# Remove leading # to set options mainlyuseful for reporting servers.
# The server defaults are faster fortransactions and fast SELECTs.
# Adjust sizes as needed, experiment tofind the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
character-set-server=utf8
[client]
loose-default-character-set = utf8
[WinMySQLadmin]
Server ="D:\mysql-5.6.32-winx64\bin\mysqld.exe"
#skip-grant-tables
四、安装服务
打开cmd进入安装目录
执行安装命令mysqld –install
启动服务cmd中运行命令:net start mysql
进入mysql修改密码 cmd运行命令:mysql -u root -p
输入密码进入mysql 就是安装时产生的密码不记得了在配置文件中加上skip-grant-tables重启服务无密码进入mysql
这里用了用SET PASSWORD命令修改密码(set password for root@localhost = password('123'); )
不同版本命名可能有些区别比如还可以用(ALTER USER 'root'@'localhost' IDENTIFIED BY '123';)
退出mysql 再次进入就可以使用修改的密码了
五、配置远程连接
允许远程访问的用户,用户名是root,密码是123456(GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456' WITH
GRANT OPTION;)%来表示所有IP
(flush privileges;)刷新权限可以根据服务器IP和端口设置远程连接了