首页 > 数据库 >mysql数据库安装

mysql数据库安装

时间:2022-12-27 20:59:06浏览次数:67  
标签:x86 5.7 数据库 community 64 mysql node2 安装

 

下载安装sysql所需包

client包的位置:(https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-client-5.7.40-1.el7.x86_64.rpm) common包的位置:(https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-common-5.7.40-1.el7.x86_64.rpm) devel包的位置:(https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-devel-5.7.40-1.el7.x86_64.rpm) libs包的位置:(https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-libs-5.7.40-1.el7.x86_64.rpm) server包的位置:(https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-server-5.7.40-1.el7.x86_64.rpm)

 [root@node2 ~]# cd /usr/src/
 [root@node2 src]# ls
 debug kernels
 [root@node2 src]# wget https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-client-5.7.40-1.el7.x86_64.rpm https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-common-5.7.40-1.el7.x86_64.rpm https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-devel-5.7.40-1.el7.x86_64.rpm https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-libs-5.7.40-1.el7.x86_64.rpm https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-server-5.7.40-1.el7.x86_64.rpm
 #wget下载过程省略
 [root@node2 src]# ls
 debug
 kernels
 mysql-community-client-5.7.40-1.el7.x86_64.rpm
 mysql-community-common-5.7.40-1.el7.x86_64.rpm
 mysql-community-devel-5.7.40-1.el7.x86_64.rpm
 mysql-community-libs-5.7.40-1.el7.x86_64.rpm
 mysql-community-server-5.7.40-1.el7.x86_64.rpm
 [root@node2 src]# yum -y localinstall *.rpm
 #yum本地安装过程省略

关闭防火墙和selinux

 [root@node2 ~]# systemctl disable --now firewalld
 Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
 Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
 [root@node2 ~]# vim /etc/selinux/config
 # 修改SELINUX=disabled
 [root@node2 ~]# setenforce 0
 [root@node2 ~]#

启动mysqld

 [root@node2 ~]# systemctl start mysqld
 [root@node2 ~]# systemctl enable mysqld
 [root@node2 ~]# systemctl status mysqld
 ● mysqld.service - MySQL Server
    Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: >
    Active: active (running) since Tue 2022-12-27 20:29:08 CST; 43s ago
      Docs: man:mysqld(8)
            http://dev.mysql.com/doc/refman/en/using-systemd.html
  Main PID: 13600 (mysqld)
    Tasks: 27 (limit: 4723)
    Memory: 261.3M
    CGroup: /system.slice/mysqld.service
            └─13600 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.p>
 ​
 Dec 27 20:29:05 node2 systemd[1]: Starting MySQL Server...
 Dec 27 20:29:08 node2 systemd[1]: Started MySQL Server.
 ​
 [root@node2 ~]# ss -antl
 State   Recv-Q   Send-Q     Local Address:Port       Peer Address:Port   Process  
 LISTEN   0        128              0.0.0.0:22              0.0.0.0:*                
 LISTEN   0        80                     *:3306                 *:*                
 LISTEN   0        128                 [::]:22                 [::]:*                
 [root@node2 ~]#
 ​

连接mysql

查找临时登录密码

 [root@node2 ~]# grep password /var/log/mysqld.log 
 2022-12-27T12:29:06.834696Z 1 [Note] A temporary password is generated for root@localhost: ?8:m9W3w<q,p
 [root@node2 ~]#

修改登录密码

 [root@node2 ~]# mysql -uroot -p'?8:m9W3w<q,p'
 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 2
 Server version: 5.7.40
 ​
 Copyright (c) 2000, 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> set password = password("RunTime123!");
 Query OK, 0 rows affected, 1 warning (0.00 sec)
 ​
 mysql>

连接mysql

 [root@node2 ~]# mysql -uroot -p
 Enter password:
 Welcome to the MySQL monitor. Commands end with ; or \g.
 Your MySQL connection id is 3
 Server version: 5.7.40 MySQL Community Server (GPL)
 ​
 Copyright (c) 2000, 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>
 

标签:x86,5.7,数据库,community,64,mysql,node2,安装
From: https://www.cnblogs.com/msl1105/p/17008964.html

相关文章

  • MySQL的端口监听到tcp6
    问题描述mysql-uroot-P3308-p无法登陆  处理方式在my.cnf配置文件里面添加以下内容,然后重启MySQL服务。bind-address=0.0.0.0  然后就可以正常登陆......
  • 基于springboot+mybatis+mysql+html实现校园宿舍管理系统
    @目录一、系统简介二、系统主要功能界面三、其它系统四、源码下载一、系统简介本系统功能模块主要分为:信息浏览浏览功能、宿舍打卡浏览功能、学生提交信息功能、宿舍搜索......
  • 解决NVIDIA软件或驱动安装包出错
    杀毒软件!杀毒软件!杀毒软件!我用的是火绒,万万没想到,这么相信它试过各种驱动版本,系统设置都不行......
  • MySQL用户和权限管理
      总共28个权限:下面是具体的权限介绍:转载的,记录一下:一.权限表mysql数据库中的3个权限表:user 、db、 host权限表的存取过程是:1)先从user表中的host、 user、 password......
  • vue环境安装与配置
    https://www.jb51.net/article/251371.htmhttps://www.yht7.com/news/193355一、下载和安装Vue:https://nodejs.org/en/download/安装目录:D:\ProgramFiles\nodej......
  • Linux-CentOS7安装ELK-Elasticsearch-Logstash-Kibana
    下载地址Elasticsearch:https://www.elastic.co/cn/downloads/elasticsearchLogstash:https://www.elastic.co/cn/downloads/logstashKibana:https://www.elastic.co/cn/do......
  • Mysql一些小技巧
    update&selectUPDATE表aSET表a.字段=表b.字段FROM表aINNERJOIN表bON表b.字段=表a.字段WHERE{CONDITION}判断null与空selectw.SysNo,w.Name,......
  • mysql监测工具tuning-primer.sh
    下载地址:​​https://launchpad.net/mysql-tuning-primer​​将tuning-primer.sh放在mysql所在的server,若出现如下错误[root@hbase1~]#shtuning-primer.shallwhich:......
  • MySQL问题汇总
    1.先删除前面5条记录,然后再插入,mysql会自动填补5条记录的位置,但ID还是从8自增,图片中显示的从40开始是因为我前面又做了其他的操作。  好像这是Mysql的优化,你删除了前面的......
  • 数据库连接池Druid使用总结
    根据综合性能,可靠性,稳定性,扩展性,易用性等因素替换成最优的​​数据库​​连接池。Druid:druid-1.0.29数据库 Mysql.5.6.17替换目标:替换掉C3P0,用druid来替换替换原因:1、......