0
点赞
收藏
分享

微信扫一扫

安装MySQL

虚拟机恢复初始化进行联网操作

在终端上输入该命令进行下载


上传压缩包到/root目录


httpd-2.4.29.tar.bz2 
mysq180-community-release-e17-3.n... 
mvsal-boost-5.7.20.tar.az 
2022/2/28 16:47 
2022/4/28 15:18 
2022/3/15 14:19 
az2 
RPM 
GZ 
6.414 
26 KB 
47.689 KB




此时
/etc/yum.repos.d 这个路径下会生成两个仓库文件,选mysql-community.repo并进入编辑

安装MySQL_mysql



在这个文件里,默认启用8.0版本,需要将两个8.0版本的enabled的值改成0,


[mysq18ø-conrnunity] 
name=MySQL 8.0 Connunity Server 
baseurl=http://repo.mysql.com/yum/mysql-g . O -conununity/el/ //$basearch/ 
enabled-I 
gpgcheck-o 
gpgkey=f i : / / / etc /pki/ rpm- gpg/RPM- GPC-KEY - mysql


[mysql-cluster-g. Ø-conununityl 
name—MySQL Cluster g Connunity 
baseurl—http://repo.mysql.com/yum/mysql-cluster-8. O -connunity/e1/7 /$basearch/ 
enabled—O 
gpgcheck=ø 
gpgkey=file : / / /etc /pki/ rpm - gpg/RPM -GPC -KEY -mysql




保存退出后,最好在终端里安装yum
-utils这个包

yum -y
install yum-utils






此处安装以yum安装    联网下载

#   yum -y install
mysql-server  #服务器端

检查

(root@localhost rpm -qa 
mysq18e-community-re1ease-e17 
mysql - cormunity 
-server -8. e .29 
mysql - - libs - ccmpat-8 
mysql - convnunity 
-ccmnon-8.e.29 
mysql - convnun i ty 
-client-8.Ø.29 
mysql - convnunity 
[rootflocalhost 
grep mysql 
-3. noarch 
-I.e17.x86 6a 
.e.29-1.e17.x86 64 
-I.e17.x86 
-I.e17.x86 
mysq1-ccmnunity-c1ient-p1ugins-8.ø.29-1.e17.x86 
mysq1-ccmnunity-icu-data-fi1es-8.e.29-1.e17.x86 64 
-libs-8.e.29-1.e17.x86


MySQL初始化操作

#service mysqld start   #先启动服务

查看状态

Croot@localhost systemctl status mysqld .service 
mysqld. service - MySQL Server 
Loaded: loaded (/usr/lib/systemd/system/mysqld. service; enabled; vendor preset: disabled) 
Active: 
since 2e22-ø4-29 CST; IIS ago


#netstat
-tnlp

. root'yu_nvez netstat -tnlp 
Active Internet connections (only 
Proto Send—Q Local 
ror•ign Address 
PID/ Progre 
20877


查看初始化密码     eyo9q,dWRhT0

Croot@localhost 
cat /var/log/mysqld. log 
2022-04-29Tø1 : 28 : e2.377545z 
2Ø22-Ø4-29TØ1 : 28 : e2.395e64Z 
2Ø22-Ø4-29TØ1 : 28 :e3.2337esz 
2022-04-29Tø1 : 28:04.251641Z 
e 
1 
1 
6 
[system] [MY-e13169] [Server] 
[System] [MY-e13576] [InnoD3] 
[System] [MY-e13577] [InnoD3] 
[Note] [MY-ØIØ454] [Server] A 
/usr/sbin/mysqld (mysqld 8.e.29) initializing of server in progress as process 12261 
InnoDB initialization has started. 
InnoDB initialization has ended . 
temporary password is generated for root@localhost ey09q , dWRhTe


登录 使用初始化密码

[root@localhost tmysql -uroot -p ey09q,dWRhTe• 
mysql: [Warning] Using a password on the command line interface can be insecure. 
Welcome to the MySQL monitor. Commands end with ; or 
Your MySQL connection id is le 
Server version: 8.e.29 
Copyright (c) 2øøe, 2022, Oracle and/or its affiliates. 
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>


\q

退出

mysql> 
Bye 
[root@localhost


进入配置文件 添加一条命令

#vim
/etc/my.cnf 


skin-grant-tables   #用来跳过密码的验证


[mysqld] 
skin-grant-tables









举报

相关推荐

安装mysql

删除 mysql +安装 mysql

mysql安装

MySQL安装

MySQL 安装

Mysql安装

mysql 安装

Mysql安装(Linux安装)

0 条评论