MySQL 免安装配置

来源:互联网 发布:linux 系统软件测试 编辑:程序博客网 时间:2024/06/11 00:21

MySQL 版本:mysql-5.7.10-winx64
下载地址:http://dev.mysql.com/downloads/mysql/
下载第二个就是免安装版的(x64位)。

1、下载到D盘并解压。
我的安装目录为D:\mySQL\mysql-5.7.10-winx64

2、在根目录下新建一个文件:my.ini
复制下面内容,但是basedir和datadir的路径要改为自己的路径。

# For advice on how to change settings please see# http://dev.mysql.com/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.[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# These are commonly set, remove the # and set as required.basedir = D:\mySQL\mysql-5.7.10-winx64datadir = D:\mySQL\mysql-5.7.10-winx64\dataport = 3306server_id = 10001# 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 = 128Msort_buffer_size = 2Mread_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

3、配置环境变量path
我的配置为path=D:\mySQL\mysql-5.7.10-winx64\bin

4、用管理员身份安装mysql
这里写图片描述

5、用管理员打开cmd。
这里写图片描述

一些遇到的错误:

1、MySQL无法启动,并且显示“服务没有任何错误报告”

这里写图片描述

错误原因:在mysql-5.7.10中没有data文件夹,但是在my.ini配置文件里要配置data,所以我自己在前面新建了一个data文件夹,错误就在这里,配置照样配置,data文件夹不用自己新建,在安装mysql 的时候,data文件夹会自动生成,不然就会报这个错误。

2、发生系统错误2

修改:注册表的问题。
HKEY_LOCAL_MACHINE-SYSTEM-CurrentControlSet-services-mysql(服务名)-ImagePath

更改为:”D:\mySQL\mysql-5.7.10-winx64\bin\mysqld”

修改“默认”的内容:
defaults-file(默认)=”D:\mySQL\mysql-5.7.10-winx64\my.ini” mysql

3、mysql ERROR 1045 (28000): 错误解决办法

在my.ini中的[mysqld]下面加入一行:

skip-grant-tables

这样就可以root无密码登陆。

0 0
原创粉丝点击