使用apt安装MySQL
MySQL 安装记录
- 主要是为了 blog 的访问计数搞的,现在用的还是 all in boom 的文件 IO...
- apt 安装
- 配置远程访问
下载 deb 包
访问 MySQL Community Downloads,下载 deb 包,上传至服务器,或直接下载到服务器。
安装
配置安装
1 | sudo dpkg -i /PATH/version-specific-package-name.deb |
在 package configuration 中选好选项,选择确认并回车


apt 安装
随后更新源并安装 mysql-server
.
1 | sudo apt update |

选 y.
过程中要求设置 MySQL 的 root 账号的 password.

使用/测试安装
MySQL 服务
安装完成后会自动启动 MySQL
服务,可以通过systemctl
查看.
1 | systemctl status mysql |

连接服务器
1 | mysql -u root -p |
随后输入你刚设置的密码(终端下是无显的).

配置远程访问
连接 MySQL 服务器,选择 mysql 数据库
1 | use mysql; |
现在可以尝试从外部连接。
参考
- Installing MySQL on Linux Using the MySQL APT Repository