- 下载jdk
在oracle官网中下载jdk https://www.oracle.com/
2、新建 JAVA_HOME 环境变量,JAVA_HOME=C:Javajdk1.8.0_144
3、修改 path 环境变量,在path变量尾部添加%JAVA_HOME%bin
4、新建 classpath 环境变量
classpath=.;%JAVA_HOME%lib;%JAVA_HOME%libdt.jar;%JAVA_HOME%tools.jar
5、命令行中输入Java -version ,查询java的版本信息
6、解压安装包,下载mysql的压缩包
7、复制一份my.ini,配置文件分别取名为:my3306
8、安装mysql的服务,进入mysql的bin目录下执行
mysqld install MySQL3306 --defaults-file=C:softMySQL5.7mysql3306my3306.ini
9、初始化MySQL
mysqld --defaults-file=C:softMySQL5.7mysql3306my3306.ini --initialize
10、获取密码:data 目录下, xx.err 配置文件,搜索: " temporary password "
11、启动 MySQL 服务: net start MySQL3306 ; 关闭: net stop MySQL3306 ;
12、登陆:mysql -u root -P 3306 -p 输入步骤5,获取的密码:xxxx.
13、修改密码:alter user u0026#39;rootu0026#39;@u0026#39;localhostu0026#39; identified by "root";
14、刷新: flush privileges;
15、#实现可以远程连接
#update user set host=u0026#39;%u0026#39; where user = u0026#39;rootu0026#39;;
16、#错误显示
#ERROR 1062 (23000): Duplicate entry u0026#39;%-rootu0026#39; for key u0026#39;PRIMARYu0026#39;
#flush privileges;
18、上面那种方法会出现问题,必须通过授权的方法
GRANT ALL PRIVILEGES ON *.* TO u0026#39;rootu0026#39;@u0026#39;%u0026#39; IDENTIFIED BY u0026#39;123456u0026#39; WITH GRANT OPTION;
20、接着就可以执行mysql的连接了
C:UsersAdministratoru0026gt;mysql -uroot -proot -P3306 -h 127.0.0.1
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 2926
Server version: 8.0.17 MySQL Community Server - GPL
Copyright (c) 2000, 2019, 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 u0026#39;help;u0026#39; or u0026#39;hu0026#39; for help. Type u0026#39;cu0026#39; to clear the current input statement.
本文到此结束,希望对大家有所帮助。
点击排行
- 1 上升
- 2 上升
-
3
冰箱冷藏几档合适冰箱正常开到几档比较好(冰箱冷藏一般设置多少度)
上升 - 4 上升
- 5 上升
- 6 上升
- 7 上升
- 8 上升
- 9 上升
- 10 上升