当前位置:网站首页>Ubuntu22.04安装mysql
Ubuntu22.04安装mysql
2022-07-31 07:29:00 【emgexgb_sef】
第一部分:安装mysql
1.使用apt安装
sudo apt update
sudo apt install -y mysql-server
安装完成之后自动结束,不需要输入密码。
2.这里默认安装的是mysql8.0版本,因为i没有输入密码;所以无法使用mysql -u root -p进入mysql
需要执行这个命令(一定要加sudo),免密码进入mysql:
sudo mysql -uroot
然后使用sql更新用户密码:
alter user ‘root’@‘localhost’ identified with mysql_native_password by ‘your_new _password’;
然后就可以使用密码登陆mysql 的root账户了
第二部分:授权远程使用
1. 如果直接授权的话,会报错
2.因为之前修改root账号的秘密时,地址为localhost,所以这里不能直接授权其他主机访问,需要先把root账号的host修改为可以访问所有主机,再去授权。
3.记得修改完root账号的host以后要刷新权限,不然无法授权,授权之后也要刷新权限。
然后可以用navicat等工具远程连接访问啦!
先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在。深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小。自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前。因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
猜你喜欢
《opencv学习笔记》-- 仿射变换
Read Elephant Swap in one article, why does it bring such a high premium to ePLATO?
XSS靶场prompt.ml过关详解
[Interview: Concurrency 37: Multithreading: Thread Pool] Custom Thread Pool
[PSQL] SQL Basic Course Reading Notes (Chapter1-4)
2022.07.14_Daily Question
shell/bash脚本命令教程
Yu Mr Series 】 【 2022 July 022 - Go Go teaching course of container in the dictionary
完美指南|如何使用 ODBC 进行无代理 Oracle 数据库监控?
Zabbix6.2 Surprise Release!Especially optimize the performance of medium and large environment deployment!
随机推荐
MySQL 5.7 安装教程(全步骤、保姆级教程)
tqdm库的使用
van-uploader uploads images, and cannot preview the image using base64 echo
Leetcode952. Calculate maximum component size by common factor
The Perfect Guide|How to use ODBC for Agentless Oracle Database Monitoring?
Introduction and self-order of bcos
Regarding "computing power", this article is worth reading
Visual Studio新功能出炉:低优先级构建
【愚公系列】2022年07月 Go教学课程 022-Go容器之字典
google搜索技巧——程序员推荐
2022.07.22_每日一题
关于“算力”,这篇文章值得一看
Open Source | Commodity Recognition Recommender System
The Ballad of Lushan Sends Lu's Servant to the Void Boat
The first part of the R language
Vscode: Project-tree plugin
初识NK-RTU980开发板
页面懒加载
[PSQL] SQL Basic Course Reading Notes (Chapter1-4)
New in Visual Studio: Low Priority Builds