CentOS7.5下,MySQL安装配置指南
[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安装配置指南的更多相关文章
- ubuntu下MySQL安装配置及基本操作
在linux下安装方法: 分为四种:一: 直接用软件仓库自动安装(如:ubuntu下,sudo apt-get install mysql-server; Debain下用yum安装): 二:官网下载 ...
- Centos 下mysql安装配置
一.编译安装MySQL前的准备工作 安装编译源码所需的工具和库 yum install gcc gcc-c++ ncurses-devel perl 安装cmake,从http://www.cmake ...
- centos7环境下mysql安装
1.去官网下载合适的yum源安装包 https://dev.mysql.com/downloads/repo/yum/ 2.yum 本地安装 命令:yum localinstall mysql57-c ...
- Linux下MySQL 安装配置
MySQL 是最流行的关系型数据库管理系统,由瑞典MySQL AB公司开发,目前属于Oracle公司. MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言. MySQL由于其体积小.速度快 ...
- 【云计算】ubuntu下docker安装配置指南
Docker Engine安装配置 以下描述仅Docker在Ubuntu Precise 12.04 (LTS).Ubuntu Trusty 14.04 (LTS).Ubuntu Wily 15.10 ...
- CentOS 7下MySQL安装配置
安装: #centos 7 yum install -y mariadb mariadb-server mariadb-devel #debian 8 apt-get install nginx ma ...
- Win7和Ubuntu下mysql 安装配置
Windows下安装 下载对应版本的mysql安装包安装,如果安装目录为 C:\Program Files\MySQL\MySQL Server 5.6 增加环境变量 MYSQL_HOME=C:\Pr ...
- Windows下MySQL安装配置与使用
1.下载. 下载地址: http://downloads.mysql.com/archives/get/file/mysql-5.7.11-winx64.zip. NavicatforMySQL:ht ...
- CentOS7 minimal下MySQL安装
http://www.linuxidc.com/Linux/2016-12/137942.htm 首先要使用root用户登录 卸载: 1.卸载原有程序 yum remove mysql mysql-s ...
随机推荐
- 阿里云ACP系列(复习笔记,题库,视频)
本人通过阿里云ACP认证总结的复习笔记,搜集的视频以及练习题库,助力大家顺利通过阿里云云计算工程师ACP,考试交流可加群:58284982 阿里云认证ACP-ECS (试题占比:31%) 阿里云认证A ...
- java Timer和TimerTask(简单的使用)
Timer 是一个定时工具 TimerTask 是一个实现了Runnable接口抽象类,代表可以被Timer执行的任务 (1)Timer.schedule(TimerTask task,Date ti ...
- String类的format方法的用法
public class Test { public static void main(String[] args) { String url = "https://api.weixin.q ...
- 策略模式(Strategy)---行为型
1 基础知识 定义:定义了算法家族,分别封装起来,让他们可以相互替换,此模式让算法的变化不会影响到使用算法的用户(应用层).特征:可以替换掉大量的if else语句 本质:分离算法,选择实现. 使用场 ...
- PHP mysqli_options() 函数
定义和用法 mysqli_options() 函数设置额外的连接选项,用于影响连接行为. mysqli_options() 函数可以被调用若干次来设置若干个选项. <?php $con=mysq ...
- PHP mysqli_multi_query() 函数
实例 执行多个针对数据库的查询: <?php $con=mysqli_connect("localhost","my_user","my_pas ...
- 括号序列的dp问题模型
括号序列的dp问题模型 Codeforces314E ◦给定一个长度为n的仅包含左括号和问号的字符串,将问号变成左括号或 右括号使得该括号序列合法,求方案总数. ◦例如(())与()()都是合法的括号 ...
- 利用Python构建时间序列模型解决实际问题的正确姿势
要本着应用到实际工作中目的去学时间序列分析,才能深入浅出的学会,不要纠结于理论,只听我的,我有信心说明白. 本章内容 趋势分析 序列分解 序列预测 序列分解 统计学基础铺垫 划分 时间序列按照季节性划 ...
- HDU6513/CCPC2017--A Secret(KMP)
A Secret Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 256000/256000 K (Java/Others)Total ...
- Spring创建对象的方法
1.利用无参构造器创建对象. 在代码中有一个学生类Student.java package no1; public class Student { public Student(){ System.o ...