MYSQL安装与配置
1.Linux环境介绍
目前, Linux有许多发行版本,其中 Ubuntu、 Fedora等比较适合个人计算机使用,而Red Hat Enterprise Linux、 Centos比较适合服务器使用。对于初次接触 Linux的新手来说,开源免费的 Ubuntu是最好的选择,所以本书将以 Ubuntu版本为例,讲解 Linux环境下 MySQL的安装。
2.替换清华ubuntu镜像源
因国内访问ubuntu官方源速度偏慢,我们可以通过清华源代替ubuntu官方源。
可以打开网址查看:
[链接](https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/)
默认版本可能或者20.04 LTS;注意选择ubuntu版本对应版本
打开终端:
stu@stu-pc:~$ cd /etc/apt # 切换到apt目录下
stu@stu-pc:/etc/apt$ sudo cp sources.list sources.list.bak # 备份原本的软件地址
[sudo] stu 的密码:
stu@stu-pc:/etc/apt$ sudo gedit sources.list # 进行编辑
我们将内容清空。修改并保存成我们修改的软件源配置地址
保存之后进行更新。
stu@stu-pc:/etc/apt$ sudo apt update
执行如下命令,查看 mysqld是否监听3306端口。
stu@stu-pc: netstat -ano |grep 3306