Ubuntu deb文件 安装 MySQL

编程知识 行业动态 更新时间:2024-06-13 00:21:11

Ubuntu deb文件 安装 MySQL

升级系统

sudo apt update
sudo apt -y dist-upgrade 

安装常用工具

sudo apt -y install vim net-tools wget gcc make cmake lrzsz

安装依赖

sudo apt -y install libmecab2 libjson-perl 

下载离线安装包

wget https://cdn.mysql//Downloads/MySQL-8.0/mysql-server_8.0.31-1ubuntu22.04_amd64.deb-bundle.tar

解压缩安装包

mkdir mysql & tar -xvf mysql-server_8.0.31-1ubuntu22.04_amd64.deb-bundle.tar -C mysql

安装MySQL8

cd mysql 
sudo dpkg -i mysql-{common,community-client,community-client-core,community-client-plugins,client,community-server,community-server-core,server}_*.deb



修改密码和可访问主机地址

select host , user , plugin ,authentication_string from mysql.user;

ALTER USER 'root'@'localhost' IDENTIFIED BY 'lihaozhe';
flush privileges;

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'lihaozhe';
flush privileges;

update mysql.user set host = '%',plugin='mysql_native_password' where user='root';
flush privileges;

quit;

sudo systemctl restart mysql

更多推荐

Ubuntu deb文件 安装 MySQL

本文发布于:2023-03-31 09:28:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/f1315cb13fcd4a448fef9f3a45b125e0.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   Ubuntu   deb   MySQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!