1 修改默认源为阿里源(国内源速度快,内容完整,并且可以自动解决依赖):
编辑以下文件,并且修改文件内容:
sudo vim /etc/apt/source.list
deb cdrom:[Ubuntu 16.04.3 LTS _Xenial Xerus_ - Release amd64 (20170801)]/ xenial main restricted
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
修改文件执行如下命令,更新源
sudo apt-get update
2 安装mysql
2.1安装软件
sudo apt-get install mysql-server mysql-client
sudo apt-get libmysqlclient-dev
2.2查看是否成功安装,执行以下命令,查看mysql是否成功安装
2.3验证,登录mysql
2.4 编辑mysql配置文件允许远程登录:
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
注释掉bind-address = 127.0.0.1:
然后进入mysql服务,执行授权命令:
grant all on *.* to root@'%' identified by '你的密码' with grant option;
flush privileges;
然后执行quit命令退出mysql服务,执行如下命令重启mysql:
service mysql restart
2.6 远程登录验证
现在在Windows下可以使用navicat远程连接Ubuntu下的MySQL服务:ubunt安装mysql:https://www.linuxidc.com/Linux/2017-06/144805.htm