liunx系统二进制包安装编译mysql数据库

# 解压二进制压缩包
[root@localhost ~]# tar xf mysql-5.5.32-linux2.6-x86_64.tar.gz -C /usr/local/
[root@localhost ~]# cd /usr/local/mysql-5.5.32-linux2.6-x86_64/
[root@localhost mysql-5.5.32-linux2.6-x86_64]# cd .. # 给解压后的包改一个简短的名字
[root@localhost local]# mv mysql-5.5.32-linux2.6-x86_64/ mysql
[root@localhost local]# cd mysql/ # 创建mysql用户组
[root@localhost mysql]# groupadd mysql # 创建mysql系统用户
[root@localhost mysql]# useradd mysql -g mysql -M -s /sbin/nologin # 进行账户信息授权
[root@localhost mysql]# chown -R mysql.mysql /usr/local/mysql/data/ # 开始编译mysql
[root@localhost mysql]# ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
# 出现两个OK表示成功
Installing MySQL system tables...
OK
Filling help tables...
OK
......
.......... # 复制mysql文件到开机启动项
[root@localhost mysql]# \cp support-files/mysql.server /etc/init.d/mysqld #修改配置文件
[root@localhost mysql]# vim /etc/init.d/mysqld
basedir=/usr/local/mysql datadir=/usr/local/mysql/data
[root@localhost mysql]# cp support-files/my-small.cnf /etc/my.cnf # 启动mysql
[root@localhost mysql]# /etc/init.d/mysqld start
Starting MySQL.. SUCCESS!
[root@localhost mysql]# ss -antup | grep mysql
[root@localhost mysql]# ss -antup | grep 3306
tcp LISTEN 0 50 *:3306 *:* users:(("mysqld",pid=51774,fd=10))
total 76
drwxr-xr-x 2 root root 4096 Mar 27 13:09 bin 注释:# 如果无法登录mysql进入/tmp目录修改文件权限
[root@localhost /]# cd tmp/
[root@localhost tmp]# chmod 777 mysql.sock
[root@localhost tmp]# ll
total 8
srwxrwxrwx 1 mysql mysql 0 Mar 27 13:17 mysql.sock
drwx------ 3 root root 4096 Mar 25 05:50 systemd-private-ff745f55df9148699f5cdffdd3b127e8-vgauthd.service-erHGUR
drwx------ 3 root root 4096 Mar 25 05:50 systemd-private-ff745f55df9148699f5cdffdd3b127e8-vmtoolsd.service-uPpjWH # 给mysql设置密码
[root@localhost tmp]# /usr/local/mysql/bin/mysqladmin -u root password '123456' # 设置软连接使mysql命令可以被系统找到
[root@localhost sbin]# ln -s /usr/local/mysql/bin/* /usr/local/bin/
[root@localhost sbin]# which mysql
/usr/local/bin/mysql # 登录MySQL
[root@localhost sbin]# mysql -uroot -p123456
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.5.32 MySQL Community Server (GPL) Copyright (c) 2000, 2013, 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec) mysql> exit
Bye

liunx系统二进制包安装编译mysql数据库的更多相关文章

  1. 二进制包安装MySQL数据库

    1.1二进制包安装MySQL数据库 1.1.1 安装前准备(规范) [root@Mysql_server ~]# mkdir -p /home/zhurui/tools ##创建指定工具包存放路径 [ ...

  2. MySQL二进制包安装及启动问题排查

    环境部署:VMware10.0+CentOS6.9(64位)+MySQL5.7.19(64位)一.操作系统调整 # 更改时区 .先查看时区 [root@localhost ~]# date -R Tu ...

  3. CentOS 6.5系统中安装配置MySQL数据库

    就像Windows server 2003,2008中一般安装的是Sql Server 数据库,在linux系统中一般安装的是mysql数据库,而且Mysql数据库的第一个版本就是发行在Linux系统 ...

  4. MySQL二进制包安装

    mysql的安装有多种方法,这里就介绍一下二进制包安装. [root@node1 ~]# tar xvf mysql-5.7.27-linux-glibc2.12-x86_64.tar [root@n ...

  5. Mysql 通用二进制包安装

    通用二进制包安装 注意:这里有严格的平台问题: 使用时:centos5.5版本   (类似Windows下的绿色包) 下载(mirrors.sohu.com/mysql)   直接使用tar 解压到指 ...

  6. MySQL5.7单实例二进制包安装方法

    MySQL5.7单实例二进制包安装方法 一.环境 OS: CentOS release 6.9 (Final)MySQL: mysql-5.7.20-linux-glibc2.12-x86_64.ta ...

  7. CentOS6.5下安装配置MySQL数据库

    一.MySQL简介 说到数据库,我们大多想到的是关系型数据库,比如MySQL.Oracle.SQLServer等等,这些数据库软件在Windows上安装都非常的方便,在Linux上如果要安装数据库,咱 ...

  8. kubernetes实践之一:kubernetes二进制包安装

    kubernetes二进制部署 1.环境规划 软件 版本 Linux操作系统 CentOS Linux release 7.6.1810 (Core) Kubernetes 1.9 Docker 18 ...

  9. Windows平台安装配置mysql数据库

    Windows平台安装配置mysql数据库 作者:Eric 微信:loveoracle11g 去下载mysql软件 https://www.mysql.com/downloads/ https://d ...

随机推荐

  1. 【原创】linux spinlock/rwlock/seqlock原理剖析(基于ARM64)

    背景 Read the fucking source code! --By 鲁迅 A picture is worth a thousand words. --By 高尔基 说明: Kernel版本: ...

  2. Thread --三大特性 原子性,可见性,有序性

    原子性.可见性.有序性 什么是原子性 即一个操作或者多个操作 要么全部执行并且执行的过程不会被任何因素打断,要么就都不执行. 一个很经典的例子就是银行账户转账问题: 比如从账户A向账户B转1000元, ...

  3. flask中 多对多的关系 主从表之间的的增删改查

    # 角色表模型class Role(db.Model): r_id = db.Column(db.Integer, primary_key=True) r_name = db.Column(db.St ...

  4. ASP.NET Core MVC通过IViewLocationExpander扩展视图搜索路径

    IViewLocationExpander API ExpandViewLocations Razor视图路径,视图引擎会搜索该路径. PopulateValues 每次调用都会填充路由 项目目录如下 ...

  5. ASP.NET Core单文件和多文件上传并保存到服务端

    前言: 在我们日常开发中,关于图片,视频,音频,文档等相关文件上传并保存到服务端中是非常常见的一个功能,今天主要是把自己在开发中常用的两种方式记录下来方便一下直接使用,并且希望能够帮助到有需要的同学! ...

  6. MATLAB——时间,日期及显示格式

    一.日期和时间 1.生成指定格式日期和时间 标准日期格式 2.获取当前时间的数值 >> datestr(now,) ans = -- :: >> datestr(now,'yy ...

  7. prometheus+grafana实现监控过程的整体流程

    prometheus安装较为简单,下面会省略安装步骤: 一.服务器启动 Prometheus启动 ./prometheus --config.file=prometheus.yml Grafana启动 ...

  8. 第一个AWK程序的尝试

    为了统计API的访问,需要读取8个G的数据,所以学习了下文本处理神器,AWK.简单实例如下: # 以\t分割的文本 awk -F "\t" ' //获取小时的函数 function ...

  9. CentOS下的Docker-Compose离线安装

    公司服务器已经安装了 Docker 环境,但没有安装 Docker Compose,使用起来十分不便.由于服务无法连接外网,下面演示如何离线安装 Docker Compose. (1)首先访问 doc ...

  10. Vertica的这些事(六)——-vertica中group-by-和join-语句的优化

    vertica group by优化语句,先对语句进行explain 操作查看预执行计划,其中group by 分为 GROUPBY PIPELINED 和 GROUPBY HASH,通过执行计划可以 ...