- 本文章描述的是mysql是5.6.24安装。
mysql5.6以上支持utf-8mb4编码也就是支持mojo表情。
1.下载mysql5.6.24.zip(官网下载:https://www.mysql.com/downloads/)
2. 解压mysql5.6.24.zip放入指定目录:D:\java\work-framework\mysql-5.6.24-winx64
3. 拷贝根目录下面的my-default.ini文件,并改名为my.ini
配置内容如下:
####################配置文件开始################### [client] default-character-set=utf8 [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:\java\work-framework\mysql-5.6.24-winx64\datadir = D:\java\work-framework\mysql-5.6.24-winx64\dataport = 3306#erver_id = mysql# 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 ####################配置文件结束###################
4.在windows系统环境变量path,加入如下内容
D:\java\work-framework\mysql-5.6.24-winx64\bin
5.将mysqld服务添加到系统服务中:
a:切记用管理员身份运行cmd.exe
b.进入到mysql安装的目录bin中执行命令(添加服务):mysqld install MySQL --defaults-file="D:\java\work-framework\mysql-
5.6.24-winx64\my.ini"
(移除服务)同理用管理员打开cmd进入到对应mysqld的目录中执行命令:mysqld remove出现 “Install/Remove of the Service Denied! ”就是没有管理员权限,要用管理员权限才能添加/移除服务
6.启动服务/配置自动启动
a.打开系统服务管理
1(右键我的电脑管理-----服务和应用程序----服务)
2.或者在运行中输入services.msc回车,查看系统服务mysql
3.按自己需求设置手动/自动等方式启动mysql服务
4.通过cmd命令进入到mysql安装目录中的bin目录:
启动mysql命令:net start mysql
关闭mysql命令:net stop mysql
7.修改root的密码
进入mysql安装目录的bin中
命令行执行:mysql –uroot
mysql>show databases;
mysql>use mysql;
mysql> UPDATE user SET password=PASSWORD('wenthink') WHERE user='root';mysql> FLUSH PRIVILEGES;
mysql> QUIT