search
HomeDatabaseMysql TutorialMysql客户端Android版的开源产品_MySQL

Github地址:https://github.com/enbandari/aMysqlClient

引子

本着爱扯淡的一贯作风,先讲一下为什么要做个这。。

话说,从某狗实习回来之后,守着实验室的大offer实在不是咱的作风,所以就跟小伙伴们开始搞一款应用。这款应用的服务器和数据库这一摊子事儿自然习惯性的被交代给了洒家。闲话不表。却说某一夜洒家正酣睡,约摸二更时分,被客户端开发妹子一通电话唤醒,道明原委,原来Mysql数据可能出现异常,需要洒家查明真相。洒家自是百般不情愿,但还是连滚带爬,翻身下地,戳开小本,一探究竟。。

洒家自忖,若是手机可以了解此事,何须如此周折。。。

1、搜

何必重复造轮子?于是谷歌一番,不料竟无一app可令android手机操作Mysql。神伤啊。。

2、想

这可如何是好?

思忖良久,如何模拟cmd搞一个mysql命令行?开socket连3306?自行解析协议?吾非蓝翔出身,恐难以胜任呀。也是天命所归,此时洒家正翻腾服务器代码,一眼瞄上了Spring jdbc。若使jdbc连接mysql,便可省去一番协议之事,真乃得来全不费工夫也。

3、做

3.1 android不能直接用Spring核心

洒家既然决定用Spring jdbc搞定此时,定然琢磨android端如何用得起服务器框架。实验几番,不想Spring核心因为Java库文件与android冲突而不能使用。烦恼烦恼。既然如此,也省的费事,想想Spring jdbc不过也是jdbc的一层封装,只用Spring jdbc应该无妨吧?试之,果然。

3.2 保持命令上下文

洒家也是醉了。直接利用Spring jdbc企图做一命令行。也不是不可,最初未使用连接池,使得每次发送的命令都使用不同的连接。因而你想use test(test乃一库也!),然后select * from t(t乃test库中表也!),对方答曰:哦抱歉,没有t这表。

这。。

上个DBCP如何?果然问题得以解决,原因嘛,就是连接没有释放罢了。

3.3 jdbc url必须指定数据库名称

洒家真的不开心了……洒家如何知道您那数据库服务器有撒子库嘛。想来想去,只好默认为jdbc url配置库名为information_schema了,客官如有特殊需求,还请自便呐!

4、 看

洒家知道,无图无真相。页面没有那么有美感。别挑哈。

4.1 简易模式

服务列表,客官可以在此编辑自己的服务器信息。洒家把这些信息存到了客官手机的sqlite当中了,洒家才不想要你的密码呢。

\\

客官,如果您只是来围观的,劝您就选简易模式吧。

\\

数据那一页可是能够拖动的哈!上下左右,毫无压力!

\\

4.2、命令行模式

命令行模式就是客官熟悉的模式了!在此,为了方便客官输入命令,洒家提供了以下便捷的方式!

4.2.1 显示历史记录

按'mysql' 即可呼出历史记录列表~~

\

4.2.2 长按"mysql>'即可呼出常用命令

\

4.2.3 还有关键字输入快捷区

\

4.2.4 输入命令时的关键字提示

5、后记

其实程序的主体功能是洒家在回家的那次火车上搞出来的,火车上真无聊。。

千万不要开启混淆,因为混淆会导致连接失败。为啥?洒家最近面试太多,累,不想管。。

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
MySQL String Types: Storage, Performance, and Best PracticesMySQL String Types: Storage, Performance, and Best PracticesMay 10, 2025 am 12:02 AM

MySQLstringtypesimpactstorageandperformanceasfollows:1)CHARisfixed-length,alwaysusingthesamestoragespace,whichcanbefasterbutlessspace-efficient.2)VARCHARisvariable-length,morespace-efficientbutpotentiallyslower.3)TEXTisforlargetext,storedoutsiderows,

Understanding MySQL String Types: VARCHAR, TEXT, CHAR, and MoreUnderstanding MySQL String Types: VARCHAR, TEXT, CHAR, and MoreMay 10, 2025 am 12:02 AM

MySQLstringtypesincludeVARCHAR,TEXT,CHAR,ENUM,andSET.1)VARCHARisversatileforvariable-lengthstringsuptoaspecifiedlimit.2)TEXTisidealforlargetextstoragewithoutadefinedlength.3)CHARisfixed-length,suitableforconsistentdatalikecodes.4)ENUMenforcesdatainte

What are the String Data Types in MySQL?What are the String Data Types in MySQL?May 10, 2025 am 12:01 AM

MySQLoffersvariousstringdatatypes:1)CHARforfixed-lengthstrings,2)VARCHARforvariable-lengthtext,3)BINARYandVARBINARYforbinarydata,4)BLOBandTEXTforlargedata,and5)ENUMandSETforcontrolledinput.Eachtypehasspecificusesandperformancecharacteristics,sochoose

How to Grant Permissions to New MySQL UsersHow to Grant Permissions to New MySQL UsersMay 09, 2025 am 12:16 AM

TograntpermissionstonewMySQLusers,followthesesteps:1)AccessMySQLasauserwithsufficientprivileges,2)CreateanewuserwiththeCREATEUSERcommand,3)UsetheGRANTcommandtospecifypermissionslikeSELECT,INSERT,UPDATE,orALLPRIVILEGESonspecificdatabasesortables,and4)

How to Add Users in MySQL: A Step-by-Step GuideHow to Add Users in MySQL: A Step-by-Step GuideMay 09, 2025 am 12:14 AM

ToaddusersinMySQLeffectivelyandsecurely,followthesesteps:1)UsetheCREATEUSERstatementtoaddanewuser,specifyingthehostandastrongpassword.2)GrantnecessaryprivilegesusingtheGRANTstatement,adheringtotheprincipleofleastprivilege.3)Implementsecuritymeasuresl

MySQL: Adding a new user with complex permissionsMySQL: Adding a new user with complex permissionsMay 09, 2025 am 12:09 AM

ToaddanewuserwithcomplexpermissionsinMySQL,followthesesteps:1)CreatetheuserwithCREATEUSER'newuser'@'localhost'IDENTIFIEDBY'password';.2)Grantreadaccesstoalltablesin'mydatabase'withGRANTSELECTONmydatabase.TO'newuser'@'localhost';.3)Grantwriteaccessto'

MySQL: String Data Types and CollationsMySQL: String Data Types and CollationsMay 09, 2025 am 12:08 AM

The string data types in MySQL include CHAR, VARCHAR, BINARY, VARBINARY, BLOB, and TEXT. The collations determine the comparison and sorting of strings. 1.CHAR is suitable for fixed-length strings, VARCHAR is suitable for variable-length strings. 2.BINARY and VARBINARY are used for binary data, and BLOB and TEXT are used for large object data. 3. Sorting rules such as utf8mb4_unicode_ci ignores upper and lower case and is suitable for user names; utf8mb4_bin is case sensitive and is suitable for fields that require precise comparison.

MySQL: What length should I use for VARCHARs?MySQL: What length should I use for VARCHARs?May 09, 2025 am 12:06 AM

The best MySQLVARCHAR column length selection should be based on data analysis, consider future growth, evaluate performance impacts, and character set requirements. 1) Analyze the data to determine typical lengths; 2) Reserve future expansion space; 3) Pay attention to the impact of large lengths on performance; 4) Consider the impact of character sets on storage. Through these steps, the efficiency and scalability of the database can be optimized.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.