摘抄这篇文档是为了记录自己的日常学习情况,方便以后查看。后边注明了来源,如有不对的地方,希望大家指正,谢谢!

首先从mysql官网上下载所需的离线包,我现在的版本是(mysql-5.6.37-linux-glibc2.12-x86_64)。

下载链接:http://dev.mysql.com/downloads/mysql/

Select Operating System:  linux-generic,选择(mysql-5.6.37-linux-glibc2.12-x86_64)下载。

下载完之后,将tar包拷贝到/usr/loacl目录下解压缩:

tar -xzvf  mysql-5.6.37-linux-glibc2.12-x86_64

  • 重命名为mysql:
  mv  mysql-5.6.37-linux-glibc2.12-x86_64  mysql
  • 在安装之前先升级源文件和安装一个依赖包,mysql运行的时候会用到这个依赖包,否则运行不了:
  • sudo apt-get update
    sudo apt-get upgrade
  • sudo apt-get install libaio-dev
    • 1依赖包安装完之后就该安装mysql了,在/usr/local/mysql目录下运行命令(后同),:(注意输出的文字,里边有修改root密码和启动mysql的命令)
        ./scripts/mysql_install_db --user=root
       Installing MySQL system tables...
       151015 14:11:15 [Note] ./bin/mysqld (mysqld 5.5.45) starting as process 10902 ...
       OK
       Filling help tables...
       151015 14:11:15 [Note] ./bin/mysqld (mysqld 5.5.45) starting as process 10908 ...
       OK    To start mysqld at boot time you have to copy
       support-files/mysql.server to the right place for your system    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
       To do so, start the server, then issue the following commands:    ./bin/mysqladmin -u root password 'new-password'
       ./bin/mysqladmin -u root -h qiuxiao-ubuntu password 'new-password'    Alternatively you can run:
       ./bin/mysql_secure_installation    which will also give you the option of removing the test
       databases and anonymous user created by default.  This is
       strongly recommended for production servers.    See the manual for more instructions.    You can start the MySQL daemon with:
       cd . ; ./bin/mysqld_safe &    You can test the MySQL daemon with mysql-test-run.pl
       cd ./mysql-test ; perl mysql-test-run.pl    Please report any problems at http://bugs.mysql.com/
    • 启动mysql,指定root用户:
        ./bin/mysqld_safe --user=root &
    • 设置root用户密码
        ./bin/mysqladmin -u root password 'linxiaohui'
    ##
    重启mysql:    ./bin/mysqladmin -uroot -p密码 shutdown(注意,u,p后没有空格)
       ./bin/mysqld_safe --user=root &
    eg:
    • 重启mysql:
        ./bin/mysqladmin -uroot -plinxiaohuishutdown(注意,u,p后没有空格)
       ./bin/mysqld_safe --user=root &
  • eg1:    root@suepc:/usr/local/mysql/mysql-5.6.37-linux-glibc2.12-x86_64# ./bin/mysqld_safe --user=root &
  • eg2:   root@suepc:/usr/local/mysql/mysql-5.6.37-linux-glibc2.12-x86_64# ./bin/mysql -u root -p
  • 运行eg1和eg2两条命令,成功进入mysql.
    • 设置允许root远程连接: 
      1)本机登陆mysql:

      ./bin/mysql -u root -p

      2)从所有主机:

      mysql> grant all privileges on *.* to root@"%" identified by "root用户的密码" with grant option;

      3)从指定主机:

      mysql> grant all privileges on *.* to root@"192.168.11.205" identified by "root用户的密码" with grant option; flush privileges;
    • 设置字符集: 
      查询字符集:

      mysql> show variables like 'character%';
      • 1

      mysql> SET character_set_database = utf8;
      mysql> SET character_set_server = utf8;
      • 1
      • 2

      重启,使字符集生效

    • 设置开机启动 
      可以通过support-files下的mysql.server启动停止mysql,命令如下: 
      启动mysql:./support-files/mysql.server start –user=root 
      停止mysql:./support-files/mysql.server stop

      1)mysql启动默认使用的是/etc/my.cnf配置文件,所以拷贝一份配置文件到/etc/下:

      cp ./support-files/my-medium.cnf /etc/my.cnf
      • 1

      2)拷贝mysql.server文件到/etc/init.d/目录下:

      cp ./support-files/mysql.server /etc/init.d/mysql.server
      • 1

      3)指定启动时所使用的用户,修改my.cnf配置文件,在[mysqld]下加一行user=root:

      vim /etc/my.cnf
      • 1


      4)设置开机启动:

      update-rc.d -f mysql.server defaults
      • 1

    至此,mysql安装完毕,重启Ubuntu,验证一下mysql是否已经随机启动 

    Navicat连接mysql 

    由图可知,连接成功!

参考出处:http://blog.csdn.net/qiuxiao630320/article/details/49150585


ubuntu14.04安装mysql5.6.37的更多相关文章

  1. Ubuntu14.04安装配置web/ftp/tftp/dns服务器

    目录: 1.安装ftp服务器vsftpd --基于tcp,需要帐号密码 2.安装tftp服务器tftpd-hpa,tftp-hpa --udp 3.web服务器--使用Apache2+Mysql+PH ...

  2. Ubuntu14.04安装intel集显驱动

    Ubuntu14.04安装intel集显驱动 标签(空格分隔): ubuntu linux 驱动安装 1.查看本机显卡型号 使用lspci命令来获取PCI接口硬件信息 o@o-pc:~$ lspci ...

  3. Ubuntu14.04安装中文输入法以及解决Gedit中文乱码问题

    1 设置中文显示环境 1. 打开System Settings 2. 打开Personal-> Language Support. 会弹出如下对话框,提示你“语言支持没安装完整”. 点击“Rem ...

  4. Ubuntu14.04安装配置ndnSIM

    Ubuntu14.04安装配置ndnSIM 预环境 Ubuntu14.04官方系统 请先使用sudo apt-get update更新一下源列表 安装步骤 安装boost-lib sudo apt-g ...

  5. Ubuntu14.04 安装QQ国际版wine-qqintl

    Ubuntu14.04安装qq国际版方式: 首先下载,链接为:  https://pan.baidu.com/s/1boPitVD 密码:jp1j 也可去Ubuntu中文的Kylin(优麒麟)官网下载 ...

  6. 一.ubuntu14.04安装、亮度设置、显卡设置等一体化讲解

    一.ubuntu14.04安装 安装步骤很简单的,相信你只要知道并且决定安装ubuntu,你就不会在安装上有问题,下载网址 http://www.ithome.com/html/soft/81539. ...

  7. Ubuntu14.04安装samba

    Ubuntu14.04安装samba 按照惯例,首先介绍Samba.Samba是在Linux系统上实现的SMB(Server Messages Block,信息服务块)协议的一款免费软件.它实现在局域 ...

  8. Ubuntu14.04安装有道词典

    Ubuntu14.04安装有道词典之前要更新系统: sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade 在有道官网下载 ...

  9. ubuntu14.04 安装redis 2.8.9

    ubuntu14.04安装前准备工作,为了保证安装顺利,请先执行apt-get update 然后安装make 和gcc(已安装的可忽略) apt-get install make apt-get i ...

随机推荐

  1. P1850 换教室 期望dp

    P1850 换教室 题目描述 对于刚上大学的牛牛来说,他面临的第一个问题是如何根据实际情况申请合适的课程. 在可以选择的课程中,有 2n2n 节课程安排在 nn 个时间段上.在第 ii(1 \leq ...

  2. React躬行记(16)——React源码分析

    React可大致分为三部分:Core.Reconciler和Renderer,在阅读源码之前,首先需要搭建测试环境,为了方便起见,本文直接采用了网友搭建好的环境,React版本是16.8.6,与最新版 ...

  3. Docker学习(九)Volumn容器间共享数据

    Docker学习(九)Volumn容器间共享数据 volume是什么 volume在英文中是容量的意思, 在docker中是数据卷的意思,是用来保存数据的容器 为什么要进行数据共享 在集群中有多台to ...

  4. Go的http包中默认路由匹配规则

    # 一.执行流程 首先我们构建一个简单http server: ```go package main import ( "log" "net/http" ) f ...

  5. 异数OS 织梦师-纤手(二)-- LPC RPC篇

    异数OS 织梦师-纤手(二)– LPC RPC篇 本文来自异数OS社区 github: https://github.com/yds086/HereticOS 异数OS社区QQ群: 652455784 ...

  6. 代码审计之CVE-2018-7600-Drupal远程代码执行漏洞-Render API

    今天学习一下Drupal的另一个漏洞,由于渲染数组不当造成的漏洞 poc: url:http://localhost/drupal-8.5.0/user/register?element_parent ...

  7. [DP][SA][可持久化线段树]黑红兔

    源自 xyz32768 菜鸡的 FJ 省冬令营模拟赛题 原题 CF1063F Statement 给定一个长度为 \(n\) 的字符串 \(s\),仅包含小写英文字母 要从中从左往右选出若干段不相交的 ...

  8. axios请求方法封装.

    axios的使用上一般封装好对应的方法,ES6导出,直接调用,消息通知使用了ElementUI的Message组件. 这是一个封装了axios的Rest风格的工具类,包扩常用的POST,GET,PUT ...

  9. python返回值内取出某一段数据的方法

    面讲的方法只适用于返回值长度固定的内容,长度不固定,每次取得值就不会一样 比如,我们需要取出“提取码: y3rx ”“:”后面的“y3rx” 目标数据在内容的第5位到第9位,做左侧为第1位,冒号后面有 ...

  10. Eclipse CDT 插件修改自动补全

    eclipse CDT 2019-06代码补全插件 本自动补全文件已在2019-06至2019-09平台上做过测试,均已完美通过功能检测 在原来Eclipse工具补全的基础上新增26个英文字符和&qu ...