mysql5.7版本yum安装---redhat7.0
1.官网下载yum包
[root@test01 test]# wget http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm ./
2.安装mysql依赖包
[root@test01 test]# ls
mysql57-community-release-el7-10.noarch.rpm
[root@test01 test]# yum install -y mysql57-community-release-el7-10.noarch.rpm
3.安装mysql
[root@test01 test]# yum install -y mysql-community-server.x86_64
4.启动mysql服务
[root@test01 test]# systemctl start mysqld.service
mysql服务器初次启动时,会有一个初始化过程,给服务器一个空的数据目录(data)
1.服务器被初始化
2.在数据目录中生成SSL证书和密钥文件
3.安装validate_password插件并启动
4.创建超级用户“root”@“localhost”,密码被设置并且存储在错误日志文件中
5.在错误日志中找出密码并进入服务器修改密码
[root@test01 test]# grep 'temporary password' /var/log/mysqld.log
找出密码后直接登入服务器,修改密码
[root@test01 test]# mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'redhat';
密码若太过简单会报错
也可以运行mysql_secure_installation程序来修改密码,不过官网上建议5.7及以上版本不建议运行这个程序,因为这个程序的功能已经被yum存储仓库安装完成
mysql_secure_installation — Improve MySQL Installation Security for details.
Do not run mysql_secure_installation after an installation of MySQL 5.7 or higher, as the function of the program has already been performed by the Yum repository installation.
还有一种方法是编辑mysql的配置文件 my.cnf 在 [mysqld]下添加一行skip-grant-tables,重启服务
[root@test01 test]# vim /etc/my.cnf
[root@test01 test]# systemctl restart mysqld.service
[root@test01 test]# mysql -uroot
mysql> use mysql ==>使用mysql数据库
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
mysql> update user set password=PASSWORD('redhat') where user='root'; ==>修改user表的数据,修改用户root的密码
Query OK, 0 rows affected, 1 warning (0.11 sec)
Rows matched: 4 Changed: 0 Warnings: 1 mysql> flush privileges; ==>刷新权限表
Query OK, 0 rows affected (0.07 sec)
退出数据库,在编辑配置文件my.cnf,删除新增的那一行
mysql> exit
Bye
[root@test01 test]# vim /etc/my.cnf
[root@test01 test]# systemctl restart mysqld.service
[root@test01 test]# mysql -uroot -predhat
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.24 MySQL Community Server (GPL) Copyright (c) 2000, 2018, 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.设置开机自启
[root@test01 test]# systemctl enable mysqld.service
mysql5.7版本yum安装---redhat7.0的更多相关文章
- 编译安装 varnish-4.1.2和yum 安装 varnish-4.0.3
vanish可以让用户自己选择缓存数据是存于内存还是硬盘,存于内存一般基于二八法则即常访问的数据是磁盘存储的总数据五分之一,因此内存也应该是硬盘文件大概五分之一.如果有多台vanish则,总内存满足即 ...
- Mysql5.7版本编译安装及配置
配置yum安装方式 1.配置本地yum源 vim /etc/yum.repos.d/rhel-source.repo [rhel-source] name=Red Hat Enterprise Lin ...
- mysql80版本—yum安装—图文全过程
这是官网的Quick Giude:https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/ 以下为自己安装的步骤: 第一步:下载.rpm安装包 ...
- CentOS通过yum安装php7.0
一.删除旧版本 如果已经安装过php就先删除之前的版本.检查方法如下: yum list installed | grep php 然后将安装的包进行删除 比如 yum remove php.x86_ ...
- CentOS7使用yum安装MySQL8.0
1.yum仓库下载MySQL:sudo yum localinstall https://repo.mysql.com//mysql80-community-release-el7-1.noarch. ...
- Centos下Yum安装PHP7.0
默认的版本太低了,手动安装有一些麻烦,想采用Yum安装的可以使用下面的方案: 1.检查当前安装的PHP包 yum list installed | grep php 如果有安装的PHP包,先删除他们 ...
- mysql5.7版本tar包手动安装---redhat7.0
1.官网下载安装包,删除系统自带的mariadb,查到几个包,卸载几个包,总之得删除干净 [root@localhost Desktop]# yum list | grep mariadb maria ...
- mysql5.7版本免安装配置教程
自己花了两天时间才搞清楚,希望对新手有一定帮助,有问题可以联系哦! mysql分为安装版本msi,免安装要压缩版本ZIP,下载网址:http://dev.mysql.com/downloads 免安装 ...
- Red Hat Enterprise Linux / CentOS 7 yum安装zabbix4.0
添加Zabbix存储库安装存储库配置包. 该软件包包含yum(软件包管理器)配置文件. rpm -ivh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_6 ...
随机推荐
- 创建 Visual Studio 2017 离线安装
代码示例: vs_Enterprise.exe --layout E:\VS2017LAYOUT --add Microsoft.VisualStudio.Workload.NetCoreTools ...
- Windows system 在python文件操作时的路径表示方法
file_path =(r'i:\vacpy\ch10\pi_digits.txt') #将文件路径存储在变量file_path中with open (file_path) as file_objec ...
- python 名称前的单下划线
单前导下划线 _var 1.特点一 在PEP8约定中定义,以单个下划线开头的变量或方法仅供内部使用.用于指定该名称属性为“私有”.为了使其他人(或你自己)使用这些代码时将会知道以“_”开头的名称只供内 ...
- TTL与非门电路的工作原理
分立元件门电路虽然结构简单,但是存在着体积大.工作可靠性差.工作速度慢等许多缺点.1961年美国德克萨斯仪器公司率先将数字电路的元器件和连线制作在同一硅片上,制成了集成电路.由于集成电路体积小.质量轻 ...
- Lamda Expression
Expression<Func<Student, bool>> filter=s=>s.Name.Contains("a") && s ...
- Android Studio环境安装
Android Studio下载 http://www.android-studio.org/ JDK下载 https://www.oracle.com/technetwork/java/index. ...
- java线程学习之volatile关键字
volatile变量的主要作用:是使变量在多个线程间可见. 在java中每一个线程都会有一块工作内存区,其中存放着所有线程共享的主内存的变量值的拷贝.当线程执行时,它在自己的工作内存区操作这些变量,为 ...
- Java的流
Java中的流主要是用来读写文件的.只要明确你是读文件还是写文件就可以确定使用哪种流了.读:read 写:writer 1.读文件:filereader这个类,顾名思义就知道是读文件了. 2.写文 ...
- php 使用代理IP进行数据抓取
什么是代理?什么情况下会用到代理IP?代理服务器(Proxy Server),其功能就是代用户去取得网络信息,然后返回给用户.形象的说:它是网络信息的中转站.通过代理IP访问目标站,可以隐藏用户的真实 ...
- spring框架-jdbc
一.实体层的不同名字 entity 实体类 :就是和数据库表一一对应的JavaBean pojo 简单的java对象:任何应用场景的JavaBean po 持久化对象 :就是和数据库表一一对 ...