【软件安装】在Ubuntu中安装mysql5.7

参考:cubuntu安装mysql5.6_mob649e81553a70的技术博客_51CTO博客

问题1:sudo apt install mysql-server-5.7 -y 若提示mysql-server 没有可安装候选

答:

sudo nano /etc/apt/sources.list

在开头加入:

阿里源

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

更新后即可安装:

sudo apt-get update

问题2:安装完成后,mysql -u root -p命令提示Access denied for user 'root'@'localhost'

强行登录

sudo mysql

问题3:如何设置mysql的开机启动

sudo systemctl enable mysql

相关推荐
JhonKI3 分钟前
【Linux网络】构建HTTP响应与请求处理系统 - HttpResponse从理解到实现
linux·网络·http
文牧之17 分钟前
PostgreSQL 常用日志
运维·数据库·postgresql
蓝莓味柯基22 分钟前
DevOps:概念与学习路径
运维·学习·devops
FJW02081438 分钟前
【Linux】web服务器的部署和优化
linux·运维·服务器·rhce
Linux运维老纪44 分钟前
Python文件操作及数据库交互(Python File Manipulation and Database Interaction)
linux·服务器·数据库·python·云计算·运维开发
weixin_430750931 小时前
智能小助手部署 Win10 + ollama的Deepseek + CentOS+ maxKB
linux·人工智能·机器学习·语言模型·自然语言处理·centos
有谁看见我的剑了?1 小时前
docker 运行时权限和 Linux 能力了解
linux·docker·容器
平生不喜凡桃李1 小时前
Linux 进程控制
linux·运维·服务器
hope_wisdom1 小时前
Linux系统编程之内存映射
linux·mmap·内存映射·munmap
偶尔微微一笑1 小时前
sgpt在kali应用
linux·人工智能·python·自然语言处理