[root@host---- home]# grep 'temporary password' /var/log/mysqld.log
--20T02::.457613Z [Note] A temporary password is generated for root@localhost: qAD44%hu?afp

[root@host---- home]# uname -a
Linux host---- 3.10.-.el7.x86_64 # SMP Fri Apr :: UTC x86_64 x86_64 x86_64 GNU/Linux
[root@host---- home]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID=""
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION=""
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION=""
[root@host---- home]# cat /etc/redhat-release
CentOS Linux release 7.5. (Core)

[root@host---- home]# rpm -qa | grep mysql
[root@host---- home]# rpm -qa | grep mariadb
mariadb-libs-5.5.-.el7.x86_64 [root@host---- home]# rpm -e --nodeps mariadb-libs-5.5.-.el7.x86_64
[root@host---- home]# rpm -qa | grep mariadb
[root@host---- home]# rpm -qa | grep mysql

[root@host---- home]# rpm -ivh mysql-community-common-5.7.-.el7.x86_64.rpm
warning: mysql-community-common-5.7.-.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [%]
Updating / installing...
:mysql-community-common-5.7.-.e################################# [%]
[root@host---- home]# rpm -ivh mysql-community-libs-5.7.-.el7.x86_64.rpm
warning: mysql-community-libs-5.7.-.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [%]
Updating / installing...
:mysql-community-libs-5.7.-.el7################################# [%]
[root@host---- home]# rpm -ivh mysql-community-client-5.7.-.el7.x86_64.rpm
warning: mysql-community-client-5.7.-.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [%]
Updating / installing...
:mysql-community-client-5.7.-.e################################# [%]
[root@host---- home]# rpm -ivh mysql-community-server-5.7.-.el7.x86_64.rpm
warning: mysql-community-server-5.7.-.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [%]
Updating / installing...
:mysql-community-server-5.7.-.e################################# [%]

systemctl start mysqld.service    //启动mysql
systemctl status mysqld.service //查看mysql状态
systemctl stop mysqld.service //关闭mysql [root@host---- home]# ps -ef | grep mysql
mysql : ? :: /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
root : pts/ :: grep --color=auto mysql
[root@host---- home]# netstat -nltp|grep
tcp6 ::: :::* LISTEN /mysqld

[root@host---- home]# grep 'temporary password' /var/log/mysqld.log
--20T02::.457613Z [Note] A temporary password is generated for root@localhost: qAD44%hu?afp
//使用如下命令登录数据库,输入上面查询到的密码:
[root@host---- ~]# mysql -u root -p //进入数据库,使用命令set password=password("Huawei12#$");修改数据库密码。

mysql> grant all privileges on *.* to root@"%" identified by "Huawei12#$";
Query OK, rows affected, warning (0.00 sec) mysql> flush privileges;
Query OK, rows affected (0.00 sec) //配置字符编码UTF-8
//vi /etc/my.cnf
#添加
[mysqld]
character_set_server=utf8
init_connect='SET NAMES utf8' 配置文件:/etc/my.cnf
日志文件:/var/log//var/log/mysqld.log
服务启动脚本:/usr/lib/systemd/system/mysqld.service
socket文件:/var/run/mysqld/mysqld.pid

CentOS7.5下,MySQL安装配置指南的更多相关文章

  1. ubuntu下MySQL安装配置及基本操作

    在linux下安装方法: 分为四种:一: 直接用软件仓库自动安装(如:ubuntu下,sudo apt-get install mysql-server; Debain下用yum安装): 二:官网下载 ...

  2. Centos 下mysql安装配置

    一.编译安装MySQL前的准备工作 安装编译源码所需的工具和库 yum install gcc gcc-c++ ncurses-devel perl 安装cmake,从http://www.cmake ...

  3. centos7环境下mysql安装

    1.去官网下载合适的yum源安装包 https://dev.mysql.com/downloads/repo/yum/ 2.yum 本地安装 命令:yum localinstall mysql57-c ...

  4. Linux下MySQL 安装配置

    MySQL 是最流行的关系型数据库管理系统,由瑞典MySQL AB公司开发,目前属于Oracle公司. MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言. MySQL由于其体积小.速度快 ...

  5. 【云计算】ubuntu下docker安装配置指南

    Docker Engine安装配置 以下描述仅Docker在Ubuntu Precise 12.04 (LTS).Ubuntu Trusty 14.04 (LTS).Ubuntu Wily 15.10 ...

  6. CentOS 7下MySQL安装配置

    安装: #centos 7 yum install -y mariadb mariadb-server mariadb-devel #debian 8 apt-get install nginx ma ...

  7. Win7和Ubuntu下mysql 安装配置

    Windows下安装 下载对应版本的mysql安装包安装,如果安装目录为 C:\Program Files\MySQL\MySQL Server 5.6 增加环境变量 MYSQL_HOME=C:\Pr ...

  8. Windows下MySQL安装配置与使用

    1.下载. 下载地址: http://downloads.mysql.com/archives/get/file/mysql-5.7.11-winx64.zip. NavicatforMySQL:ht ...

  9. CentOS7 minimal下MySQL安装

    http://www.linuxidc.com/Linux/2016-12/137942.htm 首先要使用root用户登录 卸载: 1.卸载原有程序 yum remove mysql mysql-s ...

随机推荐

  1. 利用Post方法进行数据提交

    import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import ...

  2. Spring入门篇——第5章 Spring AOP基本概念

    第5章 Spring AOP基本概念 本章介绍Spring中AOP的基本概念和应用. 5-1 AOP基本概念及特点 5-2 配置切面aspect ref:引用另外一个Bean 5-3 配置切入点Poi ...

  3. centos6、7系统初始化脚本

    #!/bin/bash # #******************************************************************** #encoding -*-utf ...

  4. Raid0、Raid0+1、Raid1、Raid5四者的区别

    RAID,可以把硬盘整合成一个大磁盘,还可以在大磁盘上再分区,放数据还有一个大功能,多块盘放在一起可以有冗余(备份)RAID整合方式有很多,常用的:0 1 5 10 Raid0Raid0是所有raid ...

  5. flask调试模式

    想要启用调试模式,发现安装目前网上流行的两种方式均无法在Pycharm中打开调试模式. 1)直接在对象上设置 flask 更新到1.0以后 不支持使用debug =True 来开启调试模式了. Pri ...

  6. BZOJ 3439: Kpm的MC密码 (trie+dfs序主席树)

    题意 略 分析 把串倒过来插进trietrietrie上, 那么一个串的kpmkpmkpm串就是这个串在trietrietrie上对应的结点的子树下面的所有字符串. 那么像 BZOJ 3551/354 ...

  7. luogu SP8093 后缀自动机+树状数组+dfs序

    这题解法很多,简单说几个: 1. 线段树合并,时间复杂度是 $O(nlog^2n)$ 的. 2. 暴力跳 $fail,$ 时间复杂度 $O(n\sqrt n),$ 比较暴力. 3. 建立后缀树后在 $ ...

  8. CodeForces–830B--模拟,树状数组||线段树

    B. Cards Sorting time limit per test 1 second memory limit per test 256 megabytes input standard inp ...

  9. UVA 1393 Highways,UVA 12075 Counting Triangles —— (组合数,dp)

    先看第一题,有n*m个点,求在这些点中,有多少条直线,经过了至少两点,且不是水平的也不是竖直的. 分析:由于对称性,我们只要求一个方向的线即可.该题分成两个过程,第一个过程是求出n*m的矩形中,dp[ ...

  10. Qt5.11.2 VS2015编译activemq发送程序 _ITERATOR_DEBUG_LEVEL错误和崩溃解决

    1.问题描述: 运行环境是 win10 64位系统,开发环境是VS2015 ,Qt 5.11.2.开发activemq发送程序,遇到问题 (1)Qt5AxContainer.lib error LNK ...