Sunny的专栏

Stay Hungry Stay Foolish

mysql-5.6.25免安装版配置方法

一、首先要下载mysql-5.6.25-winx64,这里就不提供下载了

二、解压在“D:\Mysql“,可以根据自己实际情况选择,MySQL的全路径即为:“D:\Mysql\mysql-5.6.25-winx64”

三、配置my.ini文件,将下面的配置保存成my.ini,放在“D:\Mysql\mysql-5.6.25-winx64”下

 # For advice on how to change settings please see
 # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
 # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the

 # *** default locationduring install, and will be replaced if you
 # *** upgrade to a newer version of MySQL.
 [client]  
  port=3306
  default-character-set=utf8

[mysqld]
 port=3306
 character_set_server=utf8

# 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.6.25-winx64
 datadir = D:\Mysql\mysql-5.6.25-winx64\data

# port = .....
# server_id = .....


# 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 = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
[WinMySQLAdmin]
D:\Mysql\mysql-5.6.25-winx64\bin\mysqld.exe

对于上面的配置路径,要根据实际情况进行变化

四、配置环境变量

1)右键单击我的电脑->属性->高级系统设置(高级)->环境变量

     新建系统变量:MYSQL_HOME

    值为MySQL的解压路径:D:\Mysql\mysql-5.6.25-winx64

2)编辑环境变量path

    path的最前面加"%MYSQL_HOME%\bin;",然后确定

    注意如果添加在path的前面,要注意后面的分号,一定要有;如果添加path的前面,要注意前面一定要有分号

五、注册MySQL服务

1)以管理员身份运行命令提示符,切换到MySQL的解压路径下的bin目录,D:\Mysql\mysql-5.6.25-winx64\bin>

2)注册服务:D:\Mysql\mysql-5.6.25-winx64\bin>mysqld install MySQL--defaults-file="D:\Mysql\mysql-5.6.25-winx64\my.ini"

3)启动MySQL服务

 以管理员身份运行命令提示符,然后执行:net start mysql

六、修改MySQL root的密码

C:\Users\user>mysql–uroot

mysql>show databases;

mysql>use mysql;

mysql>UPDATE user SET password=PASSWORD("123456")WHERE user='root';

mysql>FLUSH PRIVILEGES;

mysql>QUIT

七、帮助

1如果要卸载MySQL服务,D:\Mysql\mysql-5.6.25-winx64\bin>mysqld remove

2)停止MySQL服务:net stop mysql

3)在启动MySQL服务的时候可能会遇到1067的错误,可以检查向下盘符配置的是否正确,或者更换路径


阅读更多
文章标签: mysql
上一篇Java 工作2年后需要达到怎么样的技术水平
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭