当前位置:网站首页>Ubuntu下安装mysql笔记
Ubuntu下安装mysql笔记
2022-08-11 05:24:00 【Three Big Stones】
1.首先更新本地存储库索引,执行sudo apt update
2.执行安装命令:sudo apt install mysql-server -y,遇到下面的报错
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
执行删除命令:
sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/lib/dpkg/lock
然后继续执行安装命令:sudo apt install mysql-server -y
3.查看mysql服务是否启动:systemctl status mysql.service
[email protected]:~/Downloads$ systemctl status mysql.service
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en
Active: active (running) since Fri 2022-07-22 08:09:26 PDT; 7min ago
Main PID: 9595 (mysqld)
Tasks: 28 (limit: 1087)
CGroup: /system.slice/mysql.service
└─9595 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid
Jul 22 08:09:26 ubuntu systemd[1]: Starting MySQL Community Server...
Jul 22 08:09:26 ubuntu systemd[1]: Started MySQL Community Server.
4.mysql安全设置:sudo mysql_secure_installation
5.登录:sudo mysql -u root -p
6.修改密码:alter user 'root'@'localhost' identified by '12345678';
7.允许root用户远程登录:grant all privileges on *.* to 'root'@'%' identified by '12345678';
8.开通防火墙端口3306:sudo ufw allow 3306
9.修改配置,允许远程连接:
cd /etc/mysql/mysql.conf.d
sudo vim mysqld.cnf
将127.0.0.1注释掉
10.重启服务:sudo systemctl restart mysql
边栏推荐
- 如何快速转行做产品经理
- 梅科尔工作室-DjangoWeb 应用框架+MySQL数据库第二次培训
- Joint 3D Instance Segmentation and Object Detection for Autonomous Driving
- Pay “Attention” to Adverse Weather
- 弱监督语义分割CLIMS(CVPR2022)
- CMT2380F32模块开发4-UART例程
- AI-based intelligent image recognition: 4 different industry applications
- 梅科尔工作室-第四次PR培训笔记(字幕和标题动画,关键帧动画和声音处理)
- 数据库(其二)
- CNN-based Point Cloud De-Noising
猜你喜欢

梅科尔工作室-DjangoWeb 应用框架+MySQL数据库第五次培训

Waymo数据集使用介绍(waymo-open-dataset)

mAPH - Waymo dataset

【调试记录1】提高MC3172浮点运算能力,IQmath库的获取与导入使用教程

CVPR2022——Not All Points Are Equal : IA-SSD

浙江大学软件学院2020年保研上机真题练习

目标检测——Faster-RCNN 之 RCNN

目标检测——卷积神经网路基础知识

Node-3.构建Web应用(二)

Wisdom construction site safety helmet identification system
随机推荐
梅科尔工作室-HarmonyOS应用开发第三次培训
【OAuth2】授权机制
Reconstruction and Synthesis of Lidar Point Clouds of Spray
Safety helmet recognition system
CMT2380F32模块开发7-reset例程
安全帽识别
Joint 3D Instance Segmentation and Object Detection for Autonomous Driving
LAGRANGIAN FLUID SIMULATION WITH CONTINUOUS CONVOLUTIONS
Kotlin 增量编译的新方式 | 技术解析
AI-based intelligent image recognition: 4 different industry applications
弱监督语义分割CLIMS(CVPR2022)
Node-3.构建Web应用(一)
Toward a Unified Model
pip安装报错:is not a supported wheel on this platform
CVPR2020:Seeing Through Fog Without Seeing Fog
The selection points you need to know about the helmet identification system
产品版本号是如何确定的
Socket 网络协议 等
CMT2380F32模块开发11-RTC例程
博客目录