CN111639320B - 一种PhpMyAdmin数据库管理统一登录方法 - Google Patents
一种PhpMyAdmin数据库管理统一登录方法 Download PDFInfo
- Publication number
- CN111639320B CN111639320B CN202010497969.XA CN202010497969A CN111639320B CN 111639320 B CN111639320 B CN 111639320B CN 202010497969 A CN202010497969 A CN 202010497969A CN 111639320 B CN111639320 B CN 111639320B
- Authority
- CN
- China
- Prior art keywords
- phpmyadmin
- server
- login
- information
- data service
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/30—Authentication, i.e. establishing the identity or authorisation of security principals
- G06F21/31—User authentication
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/252—Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2221/00—Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/21—Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F2221/2141—Access rights, e.g. capability lists, access control lists, access tables, access matrices
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本发明提供一种PhpMyAdmin数据库管理统一登录方法,属于云计算环境下PhpMyAdmin数据库管理工具、MySQL数据库运维技术领域,本发明在原有PhpMyAdmin服务器基础上,前端获取当前租户的MySQL数据库服务地址信息列表展示,后端增加数据服务层处理验证token,然后回写验证cookie的方式登录MySQL数据库。方便MySQL数据库的运维管理工作。
Description
技术领域
本发明涉及云计算环境下PhpMyAdmin数据库管理工具、MySQL数据库运维技术,尤其涉及一种PhpMyAdmin数据库管理统一登录方法。
背景技术
PhpMyAdmin是一个用php开发的数据库管理工具。可以通过web方式控制和操作数据库。部署在一个服务器上,然后可以通过MySQL服务地址访问PhpMyAdmin。PhpMyAdmin数据库管理工具通过登录浏览器输入部署PhpMyAdmin的地址,访问PhpMyAdmin服务器,PhpMyAdmin服务器返回给用户一个登录界面,让用户输入登录数据库所需的地址,用户名,密码信息。PhpMyAdmin通过数据库地址、用户名和密码连接数据库,如果连接发生错误,返回错误信息,如果能正常连上,就会给用户返回一个操作界面,可以对数据库进行各种操作。例如查看数据表,当用户点击某个数据表,就会向PhpMyAdmin发送http请求,携带表名,PhpMyAdmin用表名去查询数据库,得到的数据包装成html界面返回给用户。
在云计算、大数据背景下,云数据库是指被优化或部署到一个虚拟计算环境中的数据库,可以实现按需付费、按需扩展、高可用性以及存储整合等优势,用户能够在云数据库控制台轻松的完成数据库申请和创建云数据库,以及销毁云数据库。MySQL数据库是云数据库关系型数据库的一种数据库,被广泛应用。用户创建多个MySQL数据库实例,通过PhpMyAdmin登录管理多个MySQL数据库,方便用户操作MySQL数据库进行各种数据库操作。
发明内容
为了解决以上技术问题,本发明提供了一种PhpMyAdmin数据库管理统一登录方法,针对部署在公有云环境上的数据库实例,基于PhpMyAdmin数据库管理统一登录功能,实现不同租户的多MySQL数据库服务的登录管理。
本发明的技术方案是:
一种PhpMyAdmin数据库管理统一登录方法,在原有PhpMyAdmin服务器基础上,前端获取当前租户的MySQL数据库服务地址信息列表展示,后端增加数据服务层处理验证token,然后回写验证cookie的方式登录MySQL数据库。
进一步的,
具体包括:
(1)前端登录界面通过浏览器登录PhpMyAdmin登录平台,选择MySQL数据库服务器,输入数据库相关信息发送登录请求给后端数据服务层;
(2)后端Java数据服务层处理需要访问的PhpMyAdmin的MySQL数据库实例的ip地址、用户名和密码等信息,发送请求token信息,封装登录信息,请求PhpMyAdmin服务器进行登录验证;
(3)PhpMyAdmin服务器端识别数据服务层请求的登录信息,返回给数据服务层验证信息;
(4)后端Java数据服务层根据验证信息结果,成功验证回写cookie返回前端登录界面;
(5)前端客户端登录界面用验证通过的cookie登录到PhpMyAdmin服务器。该方法提供登录MySQL数据库的PhpMyAdmin统一登录方法,不需要修改PhpMyAdmin服务器的配置,即可实现在前端界面通过选择登录PhpMyAdmin的MySQL数据库服务器列表,管理登录多台MySQL数据库服务器,同时能够访问用户权限的MySQL数据库,隔离不同租户数据库,方便MySQL数据库的运维管理工作。
进一步的,前端登录界面列表展示MySQL数据库服务器实例名称,调用后端Java数据服务层获取。
进一步的,后端Java数据服务层发送请求获取token信息到PhpMyAdmin服务器,服务层为了取token,PhpMyAdmin能识别是取token的请求,所以在发送取token的请求是后面加上restart=true参数请求。
进一步的,后端Java数据服务层发送请求获取token信息到PhpMyAdmin服务器,PhpMyAdmin服务器修改相应代码,针对restart=true参数的请求返回token、sessionId等信息。
进一步的,后端Java数据服务层封装登录信息,请求phpMyAdmin服务器进行验证,成功验证回写cookie返回前端登录界面,PhpMyAdmin服务器显示用户的MySQL数据库实例自定义的名称,设置verbose,并且把服务器名写入cookie。
进一步的,后端Java数据服务层封装登录信息,请求phpMyAdmin服务器进行验证,成功验证回写cookie返回前端登录界面,由于跨域问题,修改cookie设置,设置domain以及path设置httponly属性为false,因为要回写cookie给浏览器,所以cookie要可以被改动。
进一步的,后端Java数据服务层封装登录信息,请求phpMyAdmin服务器进行验证,成功验证回写cookie返回前端登录界面,当登录session过期,或者被挤掉,等一系列浏览器身份信息错误,修改错误处理,返回到前端的登录界面,修改PhpMyAdmin服务器通过返回一个javascript控制浏览器跳转。
本发明的有益效果是
本发明增加Java后端数据服务层处理MySQL数据库的登录信息,避免去修改PhpMyAdmin服务修改配置文件,省去由于修改文件带来的出错风险;同时前端界面列表展示当前用户的MySQL数据库服务,起到了MySQL数据库服务租户隔离的作用,保障了用户MySQL数据库的安全。
附图说明
图1是本发明的工作流程图;
图2是本发明的工作示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例,基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。
在云计算环境下,由于MySQL数据库服务是由用户申请和创建,以及销毁的,一个用户存在多个数据库服务,同时增加的数据库服务地址是随数据库创建时动态生成的,若要管理多个数据库服务,(1)需要不断修改PhpMyAdmin配置文件的数据库服务地址,增加修改配置文件的出错率;(2)由于存在多个用户,每个用户管理自己租户的MySQL数据库服务,不能管理其它租户的服务,需要隔离不同租户MySQL数据库服务管理功能,而PhpMyAdmin配置的是所有用户的MySQL数据库地址。基于此,本发明提供一种PhpMyAdmin数据库管理统一登录方法,实现:
(1)PhpMyAdmin远程管理多个MySQL数据库服务;
(2)管理当前用户权限的MySQL数据库实例相关信息,隔离MySQL数据库服务;
(3)后端数据服务层处理不同数据库服务的登录信息,不修改PhpMyAdmin服务器文件。
本发明的一种PhpMyAdmin数据库管理统一登录方法,由统一的浏览器客户端界面调用后端数据服务层,增加后端数据服务层处理访问PhpMyAdmin服务器管理端
本发明针对部署在公有云环境上的数据库实例,基于PhpMyAdmin数据库管理统一登录功能,实现不同租户的多MySQL数据库服务的登录管理。
前提条件:
(1)部署在公有云环境中的数据库实例能够正常运行。
(2)数据库实例的集群状态正常。
在原有PhpMyAdmin服务器基础上,前端获取当前租户的MySQL数据库服务地址信息列表展示,后端增加数据服务层处理验证token,然后回写验证cookie的方式登录MySQL数据库。具体步骤如下:
(1)用户点击登录,进入前端登录界面。
用户点击MySQL数据库实例的登录功能,进入浏览器前端登录界面,
(2)前端获取
登录界面登录列表展示当前租户MySQL数据库实例服务的实例名。
(3)后端数据服务层发送获取token的请求给PhpMyAdmin服务器。
服务层为了取token,PhpMyAdmin能识别是取token的请求,所以在发送取token的请求是后面加上restart=true参数。
(4)PhpMyAdmin服务器返回token、sessionId等信息,给数据服务层。
PhpMyAdmin针对restart=true参数的请求返回token、sessionId等信息。
(5)后端数据服务层封装MySQL数据库实例的用户信息以及token,请求PhpMyAdmin服务器进行验证
后端数据服务层根据前端登录界面选择的MySQL数据库实例服务名获取登录IP地址,封装数据库的用户名和密码信息,以及token、sessionId,发送给PhpMyAdmin服务器进行数据库登录验证。
(6)PhpMyAdmin服务器取token等信息,校验登录MySQL数据库。
(7)PhpMyAdmin服务器校验证登录成功,返回cookie信息给后端数据服务层,进入步骤(8);
PhpMyAdmin服务器显示用户的MySQL数据库实例自定义的名称,设置verbose,并且把服务器名写入cookie中,因为每次读取数据库信息都是从cookie中读的。
由于跨域问题,修改cookie设置,设置domain以及path设置httponly属性为false,因为要回写cookie,所以cookie要可以被改动。
校验失败,进入步骤(11)。
当登录session过期,或者被挤掉,等一系列浏览器身份信息错误,修改错误处理,返回到前端的登录界面,修改PhpMyAdmin服务器通过返回一个javascript控制浏览器跳转。
(8)后端数据服务层回写cookie信息,返回给前端登录界面。
(9)前端界面用登录校验成功的cookie信息访问PhpMyAdmin服务器。
(10)PhpMyAdmin展示MySQL数据库管理界面,供用户进行MySQL数据库操作。
(11)PhpMyAdmin服务器校验失败,返回错误信息,跳回登录前端页面。
以上所述仅为本发明的较佳实施例,仅用于说明本发明的技术方案,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所做的任何修改、等同替换、改进等,均包含在本发明的保护范围内。
Claims (7)
1.一种PhpMyAdmin数据库管理统一登录方法,其特征在于,
在原有PhpMyAdmin服务器基础上,前端获取当前租户的MySQL数据库服务地址信息列表展示,后端增加数据服务层处理验证token,然后回写验证cookie的方式登录MySQL数据库;
具体步骤包括:
(1)前端登录界面通过浏览器登录PhpMyAdmin登录平台,选择MySQL数据库服务器,输入数据库相关信息发送登录请求给后端数据服务层;
(2)后端Java数据服务层处理需要访问的PhpMyAdmin的MySQL数据库实例的ip地址、用户名和密码信息,发送请求token信息,封装登录信息,请求phpMyAdmin服务器进行登录验证;
(3)PhpMyAdmin服务器端识别数据服务层请求的登录信息,返回给数据服务层验证信息;
(4)后端Java数据服务层根据验证信息结果,成功验证回写cookie返回前端登录界面;
(5)前端客户端登录界面用验证通过的cookie登录到PhpMyAdmin服务器,实现登录MySQL数据库操作页面。
2.根据权利要求1所述的方法,其特征在于,
前端登录界面列表展示MySQL数据库服务器实例名称,调用后端Java数据服务层获取。
3.根据如权利要求2所述的方法,其特征在于,
后端Java数据服务层发送请求获取token信息到PhpMyAdmin服务器,服务层为了取token,PhpMyAdmin能识别是取token的请求,所以在发送取token的请求是后面加上restart=true参数请求。
4.根据如权利要求3所述的方法,其特征在于,
PhpMyAdmin服务器修改相应代码,针对restart=true参数的请求返回token、sessionId信息。
5.根据如权利要求4所述的方法,其特征在于,
后端Java数据服务层封装登录信息,请求phpMyAdmin服务器进行验证,成功验证回写cookie返回前端登录界面,PhpMyAdmin服务器显示用户的MySQL数据库实例自定义的名称,设置verbose,并且把服务器名写入cookie。
6.根据如权利要求5所述的方法,其特征在于,
修改cookie设置,设置domain以及path 设置httponly属性为false。
7.根据如权利要求6所述的方法,其特征在于,
当出现浏览器身份信息错误,修改错误处理,返回到前端的登录界面,修改PhpMyAdmin服务器通过返回一个javascript控制浏览器跳转。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010497969.XA CN111639320B (zh) | 2020-06-04 | 2020-06-04 | 一种PhpMyAdmin数据库管理统一登录方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010497969.XA CN111639320B (zh) | 2020-06-04 | 2020-06-04 | 一种PhpMyAdmin数据库管理统一登录方法 |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111639320A CN111639320A (zh) | 2020-09-08 |
CN111639320B true CN111639320B (zh) | 2022-10-04 |
Family
ID=72330751
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010497969.XA Active CN111639320B (zh) | 2020-06-04 | 2020-06-04 | 一种PhpMyAdmin数据库管理统一登录方法 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111639320B (zh) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102981440A (zh) * | 2012-11-02 | 2013-03-20 | 武汉理工大学 | 基于SaaS的智能设备监控管理系统 |
-
2020
- 2020-06-04 CN CN202010497969.XA patent/CN111639320B/zh active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102981440A (zh) * | 2012-11-02 | 2013-03-20 | 武汉理工大学 | 基于SaaS的智能设备监控管理系统 |
Non-Patent Citations (2)
Title |
---|
"如何使用phpMyAdmin创建数据库表";新叶观察;《百度经验》;20200503;全文 * |
钢铁行业分布式统一认证的研究和实现;易可可等;《冶金自动化》;20160713(第04期);第1-3部分 * |
Also Published As
Publication number | Publication date |
---|---|
CN111639320A (zh) | 2020-09-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6377113B2 (ja) | Guiナビゲーション、プロパティシート、およびオートタブコンプリーションを含むサーバ構成を管理するためのシステムおよび方法 | |
CN107948203B (zh) | 一种容器登录方法、应用服务器、系统及存储介质 | |
US8924592B2 (en) | Synchronization of server-side cookies with client-side cookies | |
US8032930B2 (en) | Segregating anonymous access to dynamic content on a web server, with cached logons | |
US11411921B2 (en) | Enabling access across private networks for a managed blockchain service | |
CN110519240B (zh) | 一种单点登录方法、装置及系统 | |
CN112597472A (zh) | 单点登录方法、装置及存储介质 | |
US10447729B2 (en) | Methods and systems for accessing a resource with multiple user identities | |
CN104219080B (zh) | 一种网站错误页日志记录方法 | |
US20080021696A1 (en) | System and method of providing a fast path link for an identified set of data | |
US11544344B2 (en) | Remote web browsing service | |
WO2014152078A1 (en) | Application architecture supporting multiple services and caching | |
US11303704B2 (en) | Methods and systems for connecting devices to applications and desktops that are receiving maintenance | |
US20210328952A1 (en) | Context Driven Dynamic Actions Embedded in Messages | |
CN111581631A (zh) | 一种基于redis的单点登录方法 | |
US7836042B2 (en) | Adaptive routing of resource requests for multiple back-end systems | |
US10705945B1 (en) | Computing system testing service | |
CN111639320B (zh) | 一种PhpMyAdmin数据库管理统一登录方法 | |
US10904011B2 (en) | Configuration updates for access-restricted hosts | |
CN106603567A (zh) | 一种web管理员的登录管理方法及装置 | |
CN110035099B (zh) | 一种多系统管理方法、终端设备及存储介质 | |
CN105681291A (zh) | 一种实现多客户端统一认证方法及系统 | |
CN107911379B (zh) | 一种cas服务器 | |
CN110933145A (zh) | 异地调度方法、装置、设备及介质 | |
US8191135B2 (en) | Secured web based access of failed flows in an integration server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20220818 Address after: 250100 No. 1036 Tidal Road, Jinan High-tech Zone, Shandong Province, S01 Building, Tidal Science Park Applicant after: Inspur cloud Information Technology Co.,Ltd. Address before: Floor S06, Inspur Science Park, No. 1036, Inspur Road, hi tech Zone, Jinan City, Shandong Province Applicant before: SHANDONG HUIMAO ELECTRONIC PORT Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |