广告
返回顶部
首页 > 资讯 > 数据库 >MySQL 5.7.28 源码安装
  • 730
分享到

MySQL 5.7.28 源码安装

2024-04-02 19:04:59 730人浏览 安东尼
摘要

MySQL 5.7.28 源码安装   一、介绍:         除了oracle商业版数据库以外, Mys

MySQL 5.7.28 源码安装

 

一、介绍:

        除了oracle商业版数据库以外, Mysql是一款源代码开放的市面上使用率最高高的RDBMS数据库软件,采用的是GPL开源协议,自己是可以修改mysql源代码用来开发自己的系统。同样也是通过最常用的sql语句进行管理

MySQL 安装方式通常分为以下三种:

l   在线Yum安装

l   离线rpm安装

l   源码编译安装

二、安装前环境清理:

前面两种安装方式都非常简单,但是所有安装方式都共同需要遵顼以下安装前的步骤:

1)        检查是否有正在运行的MySQL进程

[root@open_source ~]# ps -ef|grep mysql |grep -v grep

2)        检查是否有正在运行的MySQL服务

6.x之前

[root@open_source ~]# chkconfig --list |grep mysql

7.x之后

[root@open_source ~]# ls -rtl /etc/init.d/mysqld 
[root@open_source ~]# systemctl status mysql

3)        检查和删除是否有系统自带的Mysql或mariadb

[root@open_source ~]# rpm -qa mysql
[root@open_source ~]# rpm -qa mariadb

三、MySQL软件下载:

https://downloads.mysql.com/arcHives/commUnity/

 

四、开始安装

       4.1 环境准备

l   安装libaio-devel依赖包

[root@open_source ~]# yum install -y libaio-devel

       4.2 创建用户及目录

                  l  创建用户

[root@open_source ~]# useradd -g mysql mysql

l   创建目录

 [root@open_source ~]# mkdir /mysql/3306/data

l   赋权

[root@open_source ~]# chown -R mysql.mysql /mysql

       4.3 开始安装

l          解压软件

[root@open_source ~]# cd /usr/local/
[root@open_source local]# tar zxf mysql-5.7.28-linux-glibc2.12-x86_64.tar.gz

l          创建一个软连接并赋权

[root@open_source local]# ln -s mysql-5.7.28-linux-glibc2.12-x86_64 mysql
[root@open_source local]# chown -R mysql.mysql mysql/

l          配置环境变量

[root@open_source local]# echo "export PATH=/usr/local/mysql/bin:$PATH" /etc/profile
[root@open_source local]# source /etc/profile

l          初始化数据库

[root@open_source local]# mysqld -initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/mysql/3306/data/

l          配置My.cnf 文件

cat > /etc/my.cnf <<EOF
[mysqld]
user=mysql
basedir=/usr/local/mysql
datadir=/mysql/3306/data
log_bin=/mysql/3306/binlog/mysql-bin
server_id=7
port=3306
explicit_defaults_for_timestamp=true
Socket=/tmp/mysql.sock
[mysql]
socket=/tmp/mysql.sock
EOF

l          准备启动脚本

[root@open_source ~]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld

l          启动数据库

[root@open_source ~]# /etc/init.d/mysqld start

l          登录数据库

[root@open_source ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 29
Server version: 5.7.28-log MySQL Community Server (GPL)
 
Copyright (c) 2000, 2019, 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>

l   MySQL加固:

[root@open_source ~]# /usr/local/mysql/bin/mysql_secure_installation
 
Securing the MySQL server deployment.
 
Connecting to MySQL using a blank passWord.
 
VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?
 
Press y|Y for Yes, any other key for No: y
 
There are three levels of password validation policy:
 
LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  file
 
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0
Please set the password for root here.
 
New password: 
 
Re-enter new password: 
 
Estimated strength of the password: 50 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation Go a bit smoother.
You should remove them before moving into a production
environment.
 
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.
 
 
NORMally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.
 
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.
 
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.
 
 
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.
 
 - Removing privileges on test database...
Success.
 
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
 
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.
 
All done!

                 l  加固后无法直接登录

[root@open_source ~]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

l   查看MySQL状态

mysql> mysql> show master status;
+------------------+----------+--------------+------------------+-------------------------------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set                         |
+------------------+----------+--------------+------------------+-------------------------------------------+
| mysql-bin.000009 |     3672 |              |                  | ce8fc1bb-5fd6-11ea-869d-000c29eed638:1-20 |
+------------------+----------+--------------+------------------+-------------------------------------------+
1 row in set (0.00 sec)
 
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| bindb              |
| gtdb               |
| mdp                |
| mysql              |
| performance_schema |
| sys                |
| woo                |
+--------------------+
8 rows in set (0.00 sec)
您可能感兴趣的文档:

--结束END--

本文标题: MySQL 5.7.28 源码安装

本文链接: https://www.lsjlt.com/news/46371.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • MySQL 5.7.28 源码安装
    MySQL 5.7.28 源码安装   一、介绍:         除了Oracle商业版数据库以外, MyS...
    99+
    2022-10-18
  • win10 安装 MySQL-5.7.28 记录
    目录 一、安装前准备 二、安装步骤 三、安装时踩的坑 一、安装前准备 1.云盘下载安装包以及客户端工具 下载地址:MySQL-5.7....
    99+
    2016-05-04
    win10 安装 MySQL-5.7.28 记录
  • mysql-5.7.28在Linux下如何安装
    这篇文章给大家分享的是有关mysql-5.7.28在Linux下如何安装的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。1.官网下载Linux的版的 https://dev.mys...
    99+
    2022-10-18
  • 源码安装mysql
    创建mysql组:groupadd mysql创建mysql用户并赋予这个mysq组中,不创建家目录,不允许用户登录。(因为刚刚创建的mysql是虚拟用户,所以不允许登录)useradd mysql -g ...
    99+
    2022-10-18
  • MySQL源码安装
    1,下载源码安装包 http://dev.mysql.com/downloads/mysql/        &nb...
    99+
    2022-10-18
  • CentOS 6.2 安装 MySQL 5.7.28的教程(mysql 笔记)
    1.环境准备 1.MySQL 安装路径:/usr/local 2.CentOS 6.2 服务器(64 bit) 3.MySQL 5.7.28 下载(64bit) wget https://cdn.mys...
    99+
    2022-10-18
  • CentOS7源码安装MySQL
    CentOS7源码安装MySQL 1:安装依赖包   执行:yum -y install ncurses-devel gcc-* bzip2-* bison      2:升级cmake工具(我用的是cmake-3.22.0-rc1.ta...
    99+
    2019-12-21
    CentOS7源码安装MySQL
  • Linux 源码安装mysql
    源码安装mysql tar zxf mysql-boost-5.7.11.tar.gz rpm -ivh cmake-2.8.12.2-4.el6.x86_64.rpm yum install c...
    99+
    2022-10-18
  • Windows下mysql-5.7.28下载、安装、配置教程
    最近需要更换mysql数据库的版本,写一篇文章,记录一下 一、下载mysql数据库 mysql的下载共有两种,一种是zip压缩文件,另一种是msi安装程序 官方5.7版本zip压缩文件下载页面 官方5.7版本msi安装程序下载页面 我这...
    99+
    2016-11-12
    Windows下mysql-5.7.28下载 安装 配置教程
  • MySQL源码编译安装
    1、安装cmake-2.8.10.2.tar.gz以root用户进入shell#tar -zxvf  cmake-2.8.10.2.tar.gz#cd cmake-2.8.10.2#./confi...
    99+
    2022-10-18
  • 源码安装mysql-5.5.53.tar.gz
    操作系统:CentOSrelease 6.8 (Final)虚拟机:VMware数据库:mysql-5.5.53.tar.gz注意事项:源码安装包mysql-5.5.32.tar.gz之后的版本安装方式发生...
    99+
    2022-10-18
  • mysql源码如何安装
    这篇文章给大家分享的是有关mysql源码如何安装的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。CFLAGS="-O3 -mpentiumpro" CXX=gc...
    99+
    2022-10-18
  • MySQL如何源码安装
    小编给大家分享一下MySQL如何源码安装,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧! 源码安装的两种方法 MySQL的源码...
    99+
    2022-10-18
  • 源码编译安装mysql-5.7.14
    1.下载并上传 mysql-5.7.14.tar.gz view plain copytar -zxf msql-5.7.14.tar.gz  2...
    99+
    2022-10-18
  • CentOS6.8 x86_64bit源码安装MySQL-5.5.47
    mysql-5.5.47安装 1.提前下载源码包或进入服务器中上传源码包并解压出来cd /home/rich/toolsrz -y "mysql-5.5.47-linux2.6-x86_64.ta...
    99+
    2022-10-18
  • 源码安装与卸载mysql
    卸载 首先,删除老版本mysql相关一. 查看服务器中有没有安装过MySQL 查看有没有安装包: rpm -qa|grep mysqlyum list mysql* 删除老版本mysql相关软件yum r...
    99+
    2022-10-18
  • mysql的源码安装方法
    本篇内容介绍了“mysql的源码安装方法”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成! ...
    99+
    2022-10-18
  • mysql的源码安装过程
    本篇内容主要讲解“mysql的源码安装过程”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“mysql的源码安装过程”吧! mysql   ...
    99+
    2022-10-18
  • 怎么用源码安装MYSQL
    这篇文章主要介绍“怎么用源码安装MYSQL”,在日常操作中,相信很多人在怎么用源码安装MYSQL问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”怎么用源码安装MYSQL”的疑惑...
    99+
    2022-10-18
  • mysql 5.6源码如何安装
    这篇文章主要为大家展示了“mysql 5.6源码如何安装”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“mysql 5.6源码如何安装”这篇文章吧。创建mysql...
    99+
    2022-10-18
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作