前言
电脑是64位的, 我呢就有强迫症,软件也要装64位的。但是在访问mysql官网之后我发现mysql5.7是没有64位安装包的——好尴尬
然后进入mysql官网下载页面发现免安装的版本有64位的,就下载了64位 的压缩包。
下载
下载连接:https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.18-winx64.zip
解压(路径:E:\software\mysql-5.7.18-winx64)
文件配置
新建data文件夹
新建my.ini文件
my.ini文件内容如下
[client]
port=3306
default-character-set=utf8
[mysqld]
basedir = "E:/software/mysql-5.7.18-winx64"# 设置为MYSQL的安装目录
datadir = "E:/software/mysql-5.7.18-winx64/data"# 设置为MYSQL的数据目录
port=3306
character_set_server=utf8
sql_mode=NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER
explicit_defaults_for_timestamp=true#开启查询缓存
配置环境变量
只需要将路径指向bin目录(见图)
开始敲命令吧
以管理员身份运行“命令提示符”
命令过程如下
C:\windows\system32>mysqld -install #安装mysql
Service successfully installed.
C:\windows\system32>mysqld --initialize-insecure #mysql初始化
C:\windows\system32>net start mysql #启动mysql服务
MySQL 服务正在启动 .
MySQL 服务已经启动成功。
C:\windows\system32>mysql -uroot -p #登录mysql
Enter password: #密码为空
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.18 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, 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 for root@localhost = password('root'); #修改root用户密码为“root”
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> exit #退出mysql
Bye
C:\windows\system32>mysql -uroot -p #再次登录测试
Enter password: **** #密码为root登录成功
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.18 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, 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> exit #退出mysql
Bye
如有任何问题可在下方留言,你我共同进步。
热门评论
Note: MySQL Installer is 32 bit, but will install both 32 bit and 64 bit binaries.
为什么会输出这个,而且mysql不能启动
为什么我的会出现这个,然后mysql不能启动?