启动数据库并登录数据库
时间:2021-07-01 10:21:17
帮助过:35人阅读
、切换到对应的目录下
cd E:\MySQL\mysql-5.7.
16-winx64\bin //mysql安装在此目录下
2、首次安装需要经历的步骤
mysqld install
mysqld --initialize --console //初始化数据库,初始化后data文件夹会自动生成
mysqld
--initialize ,这一步用于初始化data目录,官方的压缩包解压后并没有data文件夹,运行命令后,自动在根目录下生成data文件夹。
3、输入命令,
//启动服务:
net start mysql
4、请输入密码,这里会生成初始密码 //第一次启动,系统会生成默认的密码
mysql -uroot
-p
E:\MySQL\mysql-5.7.
16-winx64\bin
>mysql
-uroot
-p
Enter password: ************
2016-10-22T17:
07:
30.201076Z
1 [Note] A
temporary password
is generated
for root
@localhost: Uyr#S_TsV2Hu
//初始密码
5、输入密码,进入到mysql操作台 //利用初始密码进入到mysql操作界面,‘mysql> ’有这个指示符就表示已进入到mysql操作控制台
C:\Windows\system32>mysql
-uroot
-p
Enter password: ************
Welcome to the MySQL monitor. Commands
end with ;
or \g.
Your MySQL connection id is 16
Server version: 5.7.
16
Copyright (c) 2000,
2016, 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>
6、修改密码: //利用初始密码进入到mysql控制台之后,利用修改密码命令修改新的密码
mysql> set password
for root
@localhost = password(
‘520462‘);
Query OK, 0 rows affected,
1 warning (
0.00 sec) //这里的账号和密码分别为 root 520462
启动数据库并登录数据库
标签:names cte host server row 数据 操作台 connect generated