【软件安装】在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

相关推荐
运维成长记2 小时前
linux 100个问答81~101 主要是k8s相关
linux·运维·服务器
旺小仔.3 小时前
Linux--线程
linux·运维·服务器
我言秋日胜春朝★3 小时前
【Linux网络编程】传输层协议-----UDP协议
linux·网络·udp
Mr. Cao code3 小时前
探索OpenResty:高性能Web开发利器
linux·运维·服务器·前端·nginx·ubuntu·openresty
厦门辰迈智慧科技有限公司3 小时前
水闸自动化监控系统解决方案
运维·服务器·物联网·安全·自动化·监测
Nuyoah11klay4 小时前
华清远见25072班网络编程day1
linux·服务器·网络·网络编程
努力学习的小廉4 小时前
深入了解linux系统—— 日志
linux·运维·服务器
MilesShi8 小时前
从 scheduler_tick 到上下文切换:深入解析 Linux 内核的 TIF_NEED_RESCHED 标志设置流程
linux·运维·单片机
方渐鸿10 小时前
【2024】k8s集群 图文详细 部署安装使用(两万字)
java·运维·容器·kubernetes·k8s·运维开发·持续部署
我爱云计算11 小时前
K8S详解(5万字详细教程)
linux·运维·云原生·容器·kubernetes