Ubuntu16.04部署mysql5.7

下载安装包:

wget https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb

dpkg -i mysql-apt-config_0.8.13-1_all.deb


 Ubuntu16.04部署mysql5.7_ubuntu

Ubuntu16.04部署mysql5.7_mysql_02

Ubuntu16.04部署mysql5.7_mysql_03

Ubuntu16.04部署mysql5.7_mysql_04



 


 


更新源:

apt-get update

Ubuntu16.04部署mysql5.7_ubuntu_05


安装mysql

apt-get -y install mysql-server

Ubuntu16.04部署mysql5.7_mysql_06


输入两边密码,等待安装完成

修改配置文件

vim /etc/mysql/mysql.conf.d/mysqld.cnf  ,修改bind-address 为当前服务器IP地址

Ubuntu16.04部署mysql5.7_mysql_07


启动mysql:

systemctl restart mysql

查看mysql状态

systemctl status mysql

Ubuntu16.04部署mysql5.7_mysql_08


设置开机自启:

systemctl enable mysql

开启远程访问:

命令登录mysql

mysql –uroot –p’xxxxx’

Ubuntu16.04部署mysql5.7_ubuntu_09


grant all privileges on *.* to root@'%'identified by 'xxxxxxx';

Ubuntu16.04部署mysql5.7_mysql_10