当前位置:网站首页>window平台下本地连接远程服务器数据库(一)
window平台下本地连接远程服务器数据库(一)
2022-07-27 09:59:00 【项羽-韩】
续接上文springboot,在创建用户及数据库后,咱们开始编写远程连接数据库项目,在实现远程连接数据库之前,需要对几个方面进行认证:
1、为了使远程连接数据安全,创建了一个名为【xiaochun】的用户,并赋予了对【spring】数据库的操作权限;思考:为什么不使用【root】用户连接呢?之后如何对用户管理?
2、Spring Boot是什么?Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程。该框架使用了特定的方式来进行配置,从而使开发人员不再需要定义样板化的配置。
一、创建远程登陆用户
select * from information_schema.user_privileges;
显示所有用户;
drop user 'xiaochun'@'localhost';
删除名为 【xiaochun】的用户;
flush privileges;
生效;
create user 'xiaochun'@'%' identified by '密码';
//'%':创建用户,并赋予远程登陆
flush privileges;
生效;
grant all privileges on spring.* to 'xiaochun'@'%';
给予用户【xiaochun】对数据库【spring】的所有操作权限;
生效;
flush privileges;
生效;
exit;
退出
二、远程连接
使用【mysql workbench】登陆,如下:


验证是否拥有对 spring 数据库的权限;

本节完成,下一章节介绍,如何在代码中实现。
思考:grant all privileges on *.* to 'xiaochun'@'%';
为何不可以这样编写?
边栏推荐
- Leetcode.1260. 2D grid migration____ In situ violence / dimensionality reduction + direct positioning of circular array
- Summary of binary tree exercises
- Pygame: alien invasion
- Snowflake vs. Databricks谁更胜一筹?2022年最新战报
- Decision tree principle and case application - Titanic survival prediction
- Ant advanced task
- 二叉树习题总结
- PCL各模块概述(1.6)
- Gbase 8A MPP cluster capacity expansion practice
- Ant高级-task
猜你喜欢

Metaaploit-后渗透技知识

Anchor Free检测器:CenterNet

PCL各模块概述(1.6)

Looking for a job for 4 months, interviewing 15 companies and getting 3 offers

hdu5288(OO’s Sequence)

pytorch的安装(非常详细)

3D restoration paper: shape painting using 3D generative advantageous networks and recurrent revolutionary networks

怎样关闭电脑开机自启动的应用

备战金九银十Android面试准备(含面试全流程,面试准备工作面试题和资料等)
![Shell运算符、$((运算式))” 或 “$[运算式]、expr方法、条件判断、test condition、[ condition ]、两个整数之间比较、按照文件权限进行判断、按照文件类型进行判断](/img/65/a735ca2c2902e3fc773dda79438972.png)
Shell运算符、$((运算式))” 或 “$[运算式]、expr方法、条件判断、test condition、[ condition ]、两个整数之间比较、按照文件权限进行判断、按照文件类型进行判断
随机推荐
NVIDIA geforce experience login error: the verifier failed to load. Please check your browser settings, such as the advertisement interceptor (solution)
学习Typescript(一)
How to create a.Net image with diagnostic tools
Mathematical reasoning: five couples get together and shake hands when they meet
文件上传漏洞绕过方法
Pyautogui realizes automatic office -rpa small case
语音数据采集-实时语音数据可视化
Simple use of tflite
Fsm onehot 答题记录
Qt 学习(二) —— Qt Creator简单介绍
安装CUDA失败的情况nsight visual studio edition失败
Food safety | the kitchen board environment is very important. Do you know these use details?
FSM onehot answer record
Introduction to Matlab real time editor
怎样关闭电脑开机自启动的应用
Food safety | is sugar free really sugar free? These truths need to be known
pillow的原因ImportError: cannot import name ‘PILLOW_VERSION‘ from ‘PIL‘,如何安装pillow<7.0.0
Understanding and code implementation of Se (sequence and exception) module
3D人脸重建:Joint 3D Face Reconstruction and Dense Alignment with position Map Regression Network
[SCM]源码管理 - perforce 分支的锁定