系统版本

root@sishen:~# uname -a

Linux sishen 4.10.0-35-generic #39~16.04.1-Ubuntu SMP Wed Sep 13 09:02:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

以下是通过APT的安装方式

官方参考文档

https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/

下载MySQL官方提供的deb包:

https://repo.mysql.com//mysql-apt-config_0.8.8-1_all.deb

在终端执行:

root@sishen:~# dpkg -i mysql-apt-config_0.8.8-1_all.deb ,回车之后会弹出如下窗口:

然后使用方向键选择OK,回车即可。

root@sishen:~# apt-get update

安装

root@sishen:~# apt-get install –y mysql-server

查看状态

root@sishen:~# service mysql status

● mysql.service - MySQL Community Server
    Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en
    Active: active (running) since 一 2017-11-06 11:05:17 CST; 25s ago
  Main PID: 46339 (mysqld)
    CGroup: /system.slice/mysql.service
            └─46339 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysql

11月 06 11:05:16 sishen systemd[1]: Starting MySQL Community Server...

11月 06 11:05:17 sishen systemd[1]: Started MySQL Community Server.

root@sishen:~# netstat -tap | grep mysql

tcp        0      0 localhost:mysql         *:*                    LISTEN      47316/mysqld

使用root登录mysql,注意:我的root账户密码是123456,

root@sishen:~# 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 6

Server version: 5.7.20 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> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| sys                |

+--------------------+

4 rows in set (0.00 sec)

mysql> \q

Bye

mysql的管理员密码文件存放位置

/etc/mysql/debian.cnf

如果是以普通用户登录mysql,则需要创建mysql的普通用户

创建普通用户时,密码要求太高了,简单的都不行,最后一条命令成功了。

mysql> create user 'sishen'@'%' identified by '123qwe';

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

mysql> create user 'sishen'@'%' identified by '12345Qwer';

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

mysql> create user 'sishen'@'%' identified by '123456';

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

mysql> create user 'sishen'@'%' identified by 'SiShen@123';

Query OK, 0 rows affected (0.01 sec)

mysql> grant all privileges on *.* to 'sishen'@'%' identified by 'SiShen@123';

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

测试

root@sishen:~# mysql -usishen -pSiShen@123

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.20 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> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| sys                |

+--------------------+

4 rows in set (0.00 sec)

mysql> \q

Bye

到此安装结束。

ubuntu 16.0.4安装MySQL5.7的更多相关文章

  1. Ubuntu 16.04下安装MySQL5.7

    原文链接:https://www.linuxidc.com/Linux/2017-06/144805.htm ps:ubuntu14.04下默认安装的是MySQL5.5 首先执行下面三条命令: sud ...

  2. Windows 10下怎么远程连接 Ubuntu 16.0.4(小白级教程)

    前言: 公司因为用Ruby做开发,所有适用了Ubuntu系统,但是自己笔记本是W10,又不想装双系统,搭建开发环境,便想到倒不如自己远程操控公司电脑,这样在家的时候也可以处理一些问题.故此便有了下面的 ...

  3. ubuntu 16.0安装 hadoop2.8.3

    环境:ubuntu 16.0 需要软件:jdk ssh https://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common/ 2.8.3 安装 jdk并 ...

  4. Ubuntu 16.04 LTS 安装 Nginx/PHP 5.6/MySQL 5.7 (LNMP) 与Laravel

    Ubuntu 16.04 LTS 安装 Nginx/PHP 5.6/MySQL 5.7 (LNMP) 与Laravel 1.MySQL安装[安装 MariaDB]MariaDB是MySQL的一个分支首 ...

  5. Linux Ubuntu 16.04 初次安装使用总结zzz

    装了两天的ubuntu系统终于算是勉强能用了,来来回回装了有三四次,期间出了各种各样的毛病.但是还是被我的Google大法给治好了.为了装这个系统,算是耗了两天的时间,啥事情都没干,干耗在这上面了.所 ...

  6. Ubuntu 16.04上安装SkyEye及测试

    说明一下,在Ubuntu 16.04上安装SkyEye方法不是原创,是来自互联网,仅供学习参考. 一.检查支持软件包 gcc,make,vim(optional),ssh,subversionbinu ...

  7. ubuntu 16.04上安装php5.6

    php --ini 按下面的步骤,在ubuntu 16.04上面安装成功了 php5.6 dpkg -l | grep php| awk '{print $2}' |tr "\n" ...

  8. 在 Ubuntu 16.04 中安装支持 CPU 和 GPU 的 Google TensorFlow 神经网络软件

    TensorFlow 是用于机器学习任务的开源软件.它的创建者 Google 希望提供一个强大的工具以帮助开发者探索和建立基于机器学习的应用,所以他们在去年作为开源项目发布了它.TensorFlow ...

  9. netcore程序部署 ubuntu 16.0.4 报错 The type initializer for 'System.Net.Http.CurlHandler'的解决方案

    最近业务扩展需要把netcore程序部署到ubuntu 16.0.4上,因为代码里面用到了HttpClient 请求. 部署ubuntu后一直报错 参考地址:https://github.com/do ...

随机推荐

  1. 事件序列化器 Flume 的无数据丢失保证,Channel 和事务

    小结: 1.Flume 的持久性保证依赖于使用的持久性Channel 的保证 通过事件序列化器将Flume事件转化为外部存储格式 主要的事件序列化器: 1.文本 2.带有头信息的文本 3.Avro序列 ...

  2. vue中引入字体文件

    在用vue来写一官网的时候,想引入外部字体文件,毕竟总感觉他自己的字体有点难看,在这里记录下 1.先下载字体文件所需的.ttf文件 我这里想引入的是华文行楷字体 百度后下载了一个3M多的ttf文件 2 ...

  3. ie8的圆角问题

    pie.js的引用 1.在你的网页加载 PIE.js 脚本. 注意,用IE专用的注释,防止非IE浏览器下载. <!--[if lt IE 10]> <script type=&quo ...

  4. POJ 2017 Speed Limit (直叙式的简单模拟 编程题目 动态属性很少,难度小)

                                                                                                      Sp ...

  5. 阶乘问题(大数阶乘)简单 n! (一个大数与一个小数相乘的算法 、一个大数与一个小数的除法算法 *【模板】 )

    sdut oj 简单n! Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 给定一个数n(0 <= n <= 150), ...

  6. vue2实现自定义样式radio单选框

    先上效果 <div class="reply"> 主编已回复: <div class="radio-box" v-for="(ite ...

  7. 异常、Throwable、finally、File类(十九)

    1.异常的概述和分类 * A:异常的概述 * 异常就是Java程序在运行过程中出现的错误.* B:异常的分类 * 通过API查看Throwable * Error * 服务器宕机,数据库崩溃等 * E ...

  8. codeforces A. Kitahara Haruki's Gift 解题报告

    题目链接:http://codeforces.com/problemset/problem/433/A 题目意思:给定 n 个只由100和200组成的数,问能不能分成均等的两份. 题目其实不难,要考虑 ...

  9. codeforces 414B B. Mashmokh and ACM(dp)

    题目链接: B. Mashmokh and ACM time limit per test 1 second memory limit per test 256 megabytes input sta ...

  10. I.MX6 AW-NB177NF WIFI 驱动移植问题

    /******************************************************************************** * I.MX6 AW-NB177NF ...