系统版本:系统是最小化安装

@查看系统版本
[root@localhost ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
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="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core) 
@查看内核版本
[root@localhost ~]# cat /proc/version
Linux version 3.10.0-327.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Thu Nov 19 22:10:57 UTC 2015
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

安装包:mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz

下载地址:

官网:http://dev.mysql.com/downloads/mysql/

[BEGIN] 2017/8/24 16:49:51
Last login: Mon Aug  7 18:50:39 2017 from 10.2.202.39
--
[root@localhost ~]# groupadd MysqL
[root@localhost ~]# useradd -g MysqL -d /home/MysqL MysqL
[root@localhost ~]# mkdir /home/MysqL/data
[root@localhost ~]# mkdir /home/MysqL/log
[root@localhost ~]# cd /home/MysqL
[root@localhost MysqL]# vi /home/MysqL/log/mariadb.log
-bash: [root@localhost: command not found
[root@localhost ~]# vi /home/MysqL/log/mariadb.log
:wq
"/home/MysqL/log/mariadb.log" [New] 0L,0C written


[root@localhost ~]# cd /home/MysqL/log/
[root@localhost log]# ll
total 0
-rw-r--r--. 1 root root 0 Aug  7 19:02 mariadb.log
[root@localhost log]# cd /home/MysqL
[root@localhost MysqL]# tar -xzvf MysqL-5.7.19-linux-glibc2.12-x86_64.tar.gz
[root@localhost MysqL]# cd MysqL-5.7.19-linux-glibc2.12-x86_64
[root@localhost MysqL-5.7.19-linux-glibc2.12-x86_64]# mv * /home/MysqL/
[root@localhost MysqL-5.7.19-linux-glibc2.12-x86_64]# cd ..
[root@localhost MysqL]# rm -rf MysqL-5.7.19-linux-glibc2.12-x86_64
[root@localhost MysqL]# vi support-files/MysqL.server

@在这里增加上路径
basedir=/home/MysqL
@在这里增加上路径
datadir=/home/MysqL/data
@按Esc退出编辑模式,输入:wq 保存退出
:wq



[root@localhost MysqL]# vi /etc/my.cnf
@修改前
"/etc/my.cnf" 19L,570C[MysqLd]
datadir=/var/lib/MysqL
socket=/var/lib/MysqL/MysqL.sock
# disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run MysqLd under a different user or group,# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[MysqLd_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
# include all files from the config directory
!includedir /etc/my.cnf.d                                                           
datadir=/var/lib/mysq-- INSERT --l/home/MysqL/datasql.sock/tmp/MysqL.sock
character_set_server=utf8
init_connect='SET NAMES utf8'
[client]
default-character-set=utf8/mariadb.log/home/MysqL/log/mariadb.lid/home/MysqL/log//mariadb.pid:wq
"/etc/my.cnf" 22L,652C written
@修改后:
[MysqLd]
datadir=/home/MysqL/data
socket=/tmp/MysqL.sock
# disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run MysqLd under a different user or group,# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
character_set_server=utf8
init_connect='SET NAMES utf8'
[client]
default-character-set=utf8
[MysqLd_safe]
log-error=/home/MysqL/log/mariadb.log
pid-file=/home/MysqL/log//mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
"/etc/my.cnf" 22L,652C written


[root@localhost home]# cd /home/MysqL/
[root@localhost MysqL]# chown -R MysqL:MysqL .
@查询权限
[root@localhost MysqL]# ll
total 625676
drwxr-xr-x.  2 MysqL MysqL      4096 Aug  7 19:05 bin
-rw-r--r--.  1 MysqL MysqL     17987 Jun 22 22:13 copYING
drwxr-xr-x.  2 MysqL MysqL         6 Aug  7 19:00 data
drwxr-xr-x.  2 MysqL MysqL        52 Aug  7 19:05 docs
drwxr-xr-x.  3 MysqL MysqL      4096 Aug  7 19:05 include
drwxr-xr-x.  5 MysqL MysqL      4096 Aug  7 19:05 lib
drwxr-xr-x.  2 MysqL MysqL        24 Aug  7 19:02 log
drwxr-xr-x.  4 MysqL MysqL        28 Aug  7 19:05 man
-rw-r--r--.  1 MysqL MysqL 640650826 Aug  7 19:04 MysqL-5.7.19-linux-glibc2.12-x86_64.tar.gz
-rw-r--r--.  1 MysqL MysqL      2478 Jun 22 22:13 README
drwxr-xr-x. 28 MysqL MysqL      4096 Aug  7 19:05 share
drwxr-xr-x.  2 MysqL MysqL        86 Aug  7 19:07 support-files
@初始化实例
[root@localhost MysqL]# ./bin/MysqLd --user=MysqL --basedir=/home/MysqL --datadir=/home/MysqL/data --initialize
2017-08-07T11:09:24.645721Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-08-07T11:09:27.252970Z 0 [Warning] InnoDB: New log files created,LSN=45790
2017-08-07T11:09:27.519535Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2017-08-07T11:09:27.831349Z 0 [Warning] No existing UUID has been found,so we assume that this is the first time that this server has been started. Generating a new UUID: e0e5a75a-7b60-11e7-bde3-000c2987bdd8.
2017-08-07T11:09:27.912800Z 0 [Warning] Gtid table is not ready to be used. Table 'MysqL.gtid_executed' cannot be opened.
2017-08-07T11:09:27.914113Z 1 [Note] A temporary password is generated for root@localhost: +D<3syDc#s3<
@启动数据库
[root@localhost MysqL]# ./support-files/MysqL.server start
Starting MysqL. SUCCESS! @启动成功
[root@localhost MysqL]# ./support-files/MysqL.server stop
Shutting down MysqL.. SUCCESS! @停止数据库
@设置随机启动
[root@localhost MysqL]#  cp /home/MysqL/support-files/MysqL.server /etc/init.d/MysqLd
[root@localhost MysqL]# chmod 755 /etc/init.d/MysqLd
[root@localhost MysqL]# chkconfig --level 345 MysqLd on
@启动数据库
[root@localhost MysqL]# ./support-files/MysqL.server start
Starting MysqL. SUCCESS! 


@更改初始密码
[root@localhost MysqL]# ./bin/MysqLadmin -uroot -p'.QQ7emrasrc0' password '123456'
MysqLadmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text,use ssl connection to ensure password safety.
@建软链接
[root@localhost MysqL]# ln -s /home/MysqL/bin/MysqL /usr/bin/MysqL
[root@localhost MysqL]# MysqL -uroot -p123456

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 4
Server version: 5.7.19 MysqL Community Server (GPL)

copyright (c) 2000,2017,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> grant all on *.* to 'root'@'%' identified by '123456';
Query OK,0 rows affected,1 warning (0.00 sec)

MysqL> exit
Bye
[root@localhost MysqL]#

学习安装来源参考于:http://www.jb51.cc/article/p-bfanaylv-gk.html

感谢:QQ:929679459 的远程协助帮忙处理,十分感谢

Centos 7安装mysql数据库的更多相关文章

  1. 关于h5中的fetch方法解读(小结)

    这篇文章主要介绍了关于h5中的fetch方法解读(小结),fetch身为H5中的一个新对象,他的诞生,是为了取代ajax的存在而出现,有兴趣的可以了解一下

  2. 如何在iOS 10上设置日志级别?

    换句话说,如果我在iOS上运行的代码就像这样:那么在Console.app中看到记录的消息需要做些什么呢?

  3. 从iOS应用程序发送帖子到PHP脚本不工作…简单的解决方案就像

    我之前已经做了好几次了但是由于某些原因我无法通过这个帖子…我尝试了设置为_POST且没有的变量的PHP脚本……当它们未设置为发布时它工作精细.这是我的iOS代码:这里是PHP的一大块,POST变量不在正确的位置?我想这对于更有经验的开发人员来说是一个相当简单的答案,感谢您的帮助!解决方法$_POST是一个数组,而不是一个函数.您需要使用方括号来访问数组索引:

  4. 为什么Xcode 8(iOS 10)在控制台中打印[LogMessageLogging]

    为什么Xcode8打印[LogMessageLogging]在控制台中,当我调用地图视图时?任何人都可以提出一些建议吗?解决方法PrivacyTheunifiedloggingsystemconsidersdynamicstringsandcomplexdynamicobjectstobeprivate,anddoesnotcollectthemautomatically.Toensuretheprivacyofusers,itisrecommendedthatlogmessagesconsiststri

  5. ios – 在Swift 4中为os_log传递可变参数

    我正在尝试为Swift4/iOS11中的os_log编写一个方便的包装器,但是我已经遇到了传递可变参数的艰难战斗.基本上,我想编写一个如下所示的函数.不幸的是,我似乎无法弄清楚传递参数的神奇语法,并且在CVararg讨论的泥潭中有点迷失.(…这让我想念Python的splatting语法)解决方法我还没有找到解决方案,所以这个愚蠢的黑客:

  6. xcode – osx上的config.log是什么?它在哪里?

    任何人都可以解释’configure’是什么和做什么,一般可以找到config.log文件?

  7. api – HTTPS请求仅在iOS,Ionic 2上失败

    我有一个Ionic2应用程序,它调用SpringBootAPI将推送通知发送到其他设备.API使用HTTPS配置.APIPOST请求适用于除iOS之外的所有内容.我在服务器上的SSL证书是自签名的(可能就是这样吗?

  8. swift学习日志—— Log日志

    Log输出是程序开发中很重要的组成部分,虽然它并不是直接的业务代码,但是却可以忠实地反映我们的程序是如何工作的,以及记录程序运行的过程中发生了什么。在OC中的Log日志设置请看我的另一篇博客:设置Log日志打印开关在Swift中,最简单的输出方法就是使用print,在我们关心的地方输出字符串和值。如果我们在开发中就注意使用了统一的log输出的话,这就变得非常简单了。

  9. 使用XcodeColors 来显示XCGLogger,进行swift 的logger定制

    XcodeColors项目地址XcodeColorsinstallationinstructionsforXcode4,5,6&7:Downloadorclonetherepository.OpentheXcodeColorsprojectwithXcodeIfcompilingforXcode4,thenchangetheschemestousetheXcode4buildconfigurati

  10. swift 自定义log输出

    swift自定义log输出直接上代码

随机推荐

  1. 在airgapped(离线)CentOS 6系统上安装yum软件包

    我有一个CentOS6系统,出于安全考虑,它已经被空气泄漏.它可能从未连接到互联网,如果有,它很长时间没有更新.我想将所有.rpm软件包放在一个驱动器上,这样它们就可以脱机安装而无需查询互联网.但是,我在测试VM上遇到的问题是,即使指定了本地路径,yum仍然会挂起并尝试从在线存储库进行更新.另外,有没有办法使用yum-utils/yumdownloader轻松获取该包的所有依赖项和所有依赖项?目前

  2. centos – 命名在日志旋转后停止记录到rsyslog

    CentOS6.2,绑定9.7.3,rsyslog4.6.2我最近设置了一个服务器,我注意到在日志轮换后,named已停止记录到/var/log/messages.我认为这很奇怪,因为所有日志记录都是通过rsyslog进行的,并且named不会直接写入日志文件.这更奇怪,因为我在更新区域文件后命名了HUPed,但它仍然没有记录.在我停止并重新启动命名后,记录恢复.这里发生了什么?

  3. centos – 显示错误的磁盘大小

    对于其中一个磁盘,Df-h在我的服务器上显示错误的空白区域:Cpanel表明它只有34GB免费,但还有更多.几分钟前,我删除了超过80GB的日志文件.所以,我确信它完全错了.fdisk-l/dev/sda2也显示错误:如果没有格式化,我该怎么做才能解决这个问题?并且打开文件描述符就是它需要使用才能做到这一点.所以…使用“lsof”并查找已删除的文件.重新启动写入日志文件的服务,你很可能会看到空间可用.

  4. 如何在centos 6.9上安装docker-ce 17?

    我目前正在尝试在centOS6.9服务器上安装docker-ce17,但是,当运行yuminstalldocker-ce时,我收到以下错误:如果我用跳过的标志运行它我仍然得到相同的消息,有没有人知道这方面的方法?

  5. centos – 闲置工作站的异常负载平均值

    我有一个新的工作站,具有不寻常的高负载平均值.机器规格是:>至强cpu>256GB的RAM>4x512GBSSD连接到LSI2108RAID控制器我从livecd安装了CentOS6.564位,配置了分区,网络,用户/组,并安装了一些软件,如开发工具和MATLAB.在启动几分钟后,工作站负载平均值的值介于0.5到0.9之间.但它没有做任何事情.因此我无法理解为什么负载平均值如此之高.你能帮我诊断一下这个问题吗?

  6. centos – Cryptsetup luks – 检查内核是否支持aes-xts-plain64密码

    我在CentOS5上使用cryptsetupluks加密加密了一堆硬盘.一切都很好,直到我将系统升级到CentOS6.现在我再也无法安装磁盘了.使用我的关键短语装载:我收到此错误:在/var/log/messages中:有关如何装载的任何想法?找到解决方案问题是驱动器使用大约512个字符长的交互式关键短语加密.出于某种原因,CentOS6中的新内核模块在由旧版本创建时无法正确读取512个字符的加密密钥.似乎只会影响内核或cryptsetup的不同版本,因为在同一系统上创建和打开时,512字符的密钥将起作用

  7. centos – 大量ssh登录尝试

    22个我今天登录CentOS盒找到以下内容这是过去3天内的11次登录尝试.WTF?请注意,这是我从我的提供商处获得的全新IP,该盒子是全新的.我还没有发布任何关于此框的内容.为什么我会进行如此大量的登录尝试?是某种IP/端口扫描?基本上有4名匪徒,其中2名来自中国,1名来自香港,1名来自Verizon.这只发生在SSH上.HTTP上没有问题.我应该将罪魁祸首子网路由吗?你们有什么建议?

  8. centos – kswap使用100%的CPU,即使有100GB的RAM也可用

    >Linux内核是否应该足够智能,只需从内存中清除旧缓存页而不是启动kswap?

  9. centos – Azure将VM从A2 / 3调整为DS2 v2

    我正在尝试调整前一段时间创建的几个AzureVM,从基本的A3和标准A3到标准的DS2v2.我似乎没有能力调整到这个大小的VM.必须从头开始重建服务器会有点痛苦.如果它有所不同我在VM中运行CentOS,每个都有一个带有应用程序和操作系统的磁盘.任何人都可以告诉我是否可以在不删除磁盘的情况下删除VM,创建新VM然后将磁盘附加到新VM?

  10. centos – 广泛使用RAM时服务器计算速度减慢

    我在非常具体的情况下遇到服务器速度下降的问题.事实是:>1)我使用计算应用WRF>2)我使用双XeonE5-2620v3和128GBRAM(NUMA架构–可能与问题有关!

返回
顶部