[Linux] ubuntu 安装 mysql 5.7

ubuntu 安装 mysql 5.7使用 apt安装

链接:

官网主页:https://www.mysql.com/
下载:https://dev.mysql.com/downloads/
文档:https://dev.mysql.com/doc/refman/5.7/en/

apt安装

下载 apt : https://dev.mysql.com/downloads/mysql/
在这里插入图片描述
找不到这个图片直接进这个链接:
https://dev.mysql.com/downloads/repo/apt/
在这里插入图片描述
安装 apt 仓库:

sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb

在这里插入图片描述
回车选择 5.7

在这里插入图片描述
在这里插入图片描述

更新apt:

sudo apt update

如果更新失败:
执行下面命令

sudo dpkg-reconfigure mysql-apt-config

然后:

sudo apt update

安装 mysql :

sudo apt-get install mysql-server

查看状态:

● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2019-02-08 21:51:34 CST; 13h ago
 Main PID: 2678 (mysqld)
    Tasks: 33 (limit: 4915)
   Memory: 299.7M
   CGroup: /system.slice/mysql.service
           └─2678 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

2月 08 21:51:33 chen-PC systemd[1]: Starting MySQL Community Server...
2月 08 21:51:34 chen-PC systemd[1]: Started MySQL Community Server.

启动mysql:

sudo service mysql start

停止mysql:

sudo service mysql stop

安装 MySQL Workbench

安装 mysql workbench

sudo apt-get install mysql-workbench-community

可能要安装依赖库:

sudo apt-get install libmysqlclient18
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章