当前位置:网站首页>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
边栏推荐
- 安全帽识别
- 360°大视野安全帽识别系统-深度学习智能视频分析
- 目标检测——Faster R-CNN 之 Fast R-CNN
- Diagnostic Log and Trace——开发人员如何使用 DLT
- 关于mmdetection框架实用小工具说明
- CVPR2020:Seeing Through Fog Without Seeing Fog
- CVPR2022——Not All Points Are Equal : IA-SSD
- Diagnostic Log and Trace——DLT 离线日志存储
- Mei cole studios - sixth DjangoWeb application framework + MySQL database training
- 10 个超好用的 DataGrip 快捷键,快加入收藏! | 实用技巧
猜你喜欢
Safety helmet identification system - escort for safe production
Mei cole studios - deep learning second BP neural network
梅科尔工作室-HarmonyOS应用开发第四次培训
Robust 3D Object Detection in Cold Weather Conditions
AI-based intelligent image recognition: 4 different industry applications
Safety helmet recognition - construction safety "regulator"
KANO模型——确定需求优先级的神器
CVPR2022——Not All Points Are Equal : IA-SSD
实时姿态估计--基于空洞卷积的人体姿态估计网络
基于ijkplayer 0.8.8编译的完整so. libijkffmpeg.so等,支持ssl h265, rm, rmvb
随机推荐
用正则验证文件名是否合法
CMT2380F32模块开发5-CLK例程
CMT2380F32模块开发11-RTC例程
Maykel Studio - Django Web Application Framework + MySQL Database Fourth Training
CNN-based Point Cloud De-Noising
TAMNet:A loss-balanced multi-task model for simultaneous detection and segmentation
Mei cole studios - sixth DjangoWeb application framework + MySQL database training
Kotlin 增量编译的新方式 | 技术解析
通用的 kernel和 userspace Makefile
解决jupyter中import torch出错问题
Rethinking LiDAR Object Detection in adverse weather conditions
从概念认识AI
stm32-WS2812 PWM+DMA(自己写库函数)
HTTP缓存机制详解
Pay “Attention” to Adverse Weather
动画(其二)
Socket 网络协议 等
Pay “Attention” to Adverse Weather
360° large field of view helmet recognition system-deep learning intelligent video analysis
Safety helmet recognition system