首先要安装MySQL 数据库才能够继续安装图形工具SQLyogmysql
第一步:下载解压包》》sql
MYSQL官网地址:https://dev.mysql.com/downloads/file/?id=479669数据库
绿色安装 直接解压便可。ide
第二步》》环境变量配置工具
解压以后放入E盘,需在系统进行环境变量配置spa
==============================================================================插件
第三步》》mysql初始化配置命令行
接下来链接和启动数据库操做:code
3.1 建立初始化配置my.ini配置文件 存放根目录下面 复制下面文档(需修改路径)server
[mysqld] # 设置3306端口 port=3306 # 设置mysql的安装目录 basedir=E:\\mysql\\mysql-8.0.12-winx64 # 切记此处必定要用双斜杠\\,单斜杠我这里会出错。 # 设置mysql数据库的数据的存放目录 datadir=E:\\mysql\\mysql-8.0.12-winx64\\Data # 此处同上 # 容许最大链接数 max_connections=200 # 容许链接失败的次数。这是为了防止有人从该主机试图攻击数据库系统 max_connect_errors=10 # 服务端使用的字符集默认为UTF8 character-set-server=utf8 # 建立新表时将使用的默认存储引擎 default-storage-engine=INNODB # 默认使用“mysql_native_password”插件认证 default_authentication_plugin=mysql_native_password [mysql] # 设置mysql客户端默认字符集 default-character-set=utf8 [client] # 设置mysql客户端链接服务端时默认使用的端口 port=3306 default-character-set=utf8
3.2 在c:\Windows\system32 找到cmd.exe 右键以系统管理员身份启动该程序
指令路径切换到bin目录下输入指令:
//生成临时密码
mysqld --initialize --console
示例:
E:\mysql\mysql-8.0.12-winx64\bin>mysqld --initialize --console 2018-09-03T03:05:19.275614Z 0 [System] [MY-013169] [Server] E:\mysql\mysql-8.0.12-winx64\bin\mysqld.exe (mysqld 8.0.12) initializing of server in progress as process 7608 2018-09-03T03:05:37.017614Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: oZig3fdGSh<E 2018-09-03T03:05:50.090414Z 0 [System] [MY-013170] [Server] E:\mysql\mysql-8.0.12-winx64\bin\mysqld.exe (mysqld 8.0.12) initializing of server has completed
oZig3fdGSh<E 为系统随机生成的临时密码
3.3 安装mysql 服务
mysqld --install
示例:
E:\mysql\mysql-8.0.12-winx64\bin>mysqld --install Service successfully installed.
3.4 启动mysql服务
net start mysql
示例:
E:\mysql\mysql-8.0.12-winx64\bin>net start mysql MySQL 服务正在启动 .. MySQL 服务已经启动成功。
3.5 进入mysql 输入如下指令以后 须要输入临时密码
mysql -u root -p
示例:
E:\mysql\mysql-8.0.12-winx64\bin>mysql -u root -p Enter password: ************ Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.12 Copyright (c) 2000, 2018, 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>
3.6 修改临时密码
修改密码为root
alter user user() identified by "root";
示例:
mysql> alter user user() identified by "root"; Query OK,0 rows affected (0.25 sec)
修改完密码 退出数据库操做
mysql> exit
Bye
3.7 验证密码
E:\mysql\mysql-8.0.12-winx64\bin>mysql -u root -p Enter password: **** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 10 Server version: 8.0.12 MySQL Community Server - GPL Copyright (c) 2000, 2018, 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>
ok mysql安装完成了密码也修改为功了 命令行操做麻烦,推荐使用图形化工具SQLyog。