mysql5.7.21 密码_MySQL5.7.21安装与密码图文配置教程

MySQL5.7.21安装与密码设置教程,具体如下

1.解压MySQL 5.7.20安装包,如X:\MySQL\mysql-5.7.21-winx64。(是没有data和my.ini的)

88ced82397457eed8aee5cd9acf1b2d1

2.配置mysql的环境变量,创建MYSQL_HOME,并且在Path添加上%MYSQL_HOME%\bin;

7b434ac160d623cfd8ad15b8866bd6f3

3,配置my.ini. 并把my.ini放到bin目录下(1.如果放在mysql-5.7.21-winx64 目录下,在下面执行net start mysql时可能无法启动MYSQL服务、2.不会自动生成data)

[client]

default-character-set=utf8

[mysqld]

#解压目录 如:D:\MySQL\mysql-5.7.21-winx64

basedir = %MYSQL_HOME%

#解压目录 如:D:\MySQL\mysql-5.7.21-winx64\data

datadir = %MYSQL_HOME%\data

port = 3306

default-character-set=utf8

4. 以管理员身份进入命令行(可在小娜搜索输入cmd找到),并进入X:\MySQL\mysql-5.7.21-winx64\bin目录下输入命令:mysqld --initialize-insecure (生成无密码的root用户) 后,在mysql-5.7.20-winx64 目录下就会出现data文件

f4daf65457c999d0c6de2a560a7c10dc

5.再输入mysqld --install,如果出现Service successfully installed 说明注册成功了。

注意:如果此操作报错Install/Remove of the Service Denied!,建议使用管理员身份进入命令提示符

6e1e3a006bb2f50791067aa87225c975

6.启动MySQL服务,命令:net start mysql

c01519414ad13ac1cfcff3f6d0d02856

7.设置密码   mysqladmin -u root password 密码

8.修改密码方法如下 :接着输入mysql -uroot -p    由于之前登陆过,直接输入刚才设置密码(登录root第一次是免密码的直接回车进入到) MYSQL>

b84d5f9b60161d837e43e30a792d2789

接着输入:update mysql.user set authentication_string=password('你想输入的密码') where user='root' and Host ='localhost';    然后接着再输入: flush privileges;

529b2b5e09b022ae406be09ad3ae2db3

9.输入命令show databases;  查看数据表

5fe4996748d75e5893dda8a07cc65236

MySQL常用的命令如下

List of all MySQL commands:

Note that all text commands must be first on line and end with ';'(要以“;”结尾)

? (\?) Synonym for `help'.

clear (\c) Clear the current input statement.

connect (\r) Reconnect to the server. Optional arguments are db and host.

delimiter (\d) Set statement delimiter.

ego (\G) Send command to mysql server, display result vertically.

exit (\q) Exit mysql. Same as quit.

go (\g) Send command to mysql server.

help (\h) Display this help.

notee (\t) Don't write into outfile.

print (\p) Print current command.

prompt (\R) Change your mysql prompt.

quit (\q) Quit mysql.

rehash (\#) Rebuild completion hash.

source (\.) Execute an SQL script file. Takes a file name as an argument.

status (\s) Get status information from the server.

tee (\T) Set outfile [to_outfile]. Append everything into given outfile.

use (\u) Use another database. Takes database name as argument.

charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.

warnings (\W) Show warnings after every statement.

nowarning (\w) Don't show warnings after every statement.

resetconnection(\x) Clean session context.

10.输入 \q; 退出MySQL

11.关闭MySQL服务,命令:net stop mysql

65db65ae2ef7b3ee648dc784d6a4e11f

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

您可能感兴趣的文章:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值