当前位置:网站首页>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开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
猜你喜欢

使用PageHelper实现分页查询(详细)

2022.07.24_Daily Question

Install the deployment kubernetes KubeSphere management

48页智慧城市规划蓝图 解决方案

一文读懂Elephant Swap,为何为ePLATO带来如此高的溢价?

任务及任务切换
![Embedded system driver primary [2] - _ parameters and dependencies under the kernel module](/img/c2/22c1e087b92ed2c898f97bcf0e818b.png)
Embedded system driver primary [2] - _ parameters and dependencies under the kernel module

2022.07.29_每日一题

2022.07.14_Daily Question

安装部署KubeSphere管理kubernetes
随机推荐
2022.07.20_Daily Question
Introduction and self-order of bcos
"C language" frog jumping steps recursion problem
Practical Bioinformatics 2: Multi-omics data integration and mining
页面懒加载
金融租赁业务
2022.07.15_每日一题
navicat 新建数据库
[Interview: Concurrency 37: Multithreading: Thread Pool] Custom Thread Pool
Regarding "computing power", this article is worth reading
van-uploader uploads images, and cannot preview the image using base64 echo
Leetcode952. Calculate maximum component size by common factor
MySQL table creation statement_Three commonly used MySQL table creation statements
力扣 593. 有效的正方形
2022.07.26_每日一题
shell/bash脚本命令教程
48页智慧城市规划蓝图 解决方案
2704:寻找平面上的极大点
R语言 第一部分
C语言三子棋(井字棋)小游戏