search
HomeDatabaseMysql TutorialSecurity analysis of Mssql and Mysql
Security analysis of Mssql and MysqlFeb 20, 2017 am 11:54 AM
mssqlmysqlSecurity analysis

[Introduction] Database is the foundation of e-commerce, finance and ERP systems, and usually stores important business partner and customer information. The electronic data of most enterprises, organizations and government departments are stored in various databases. They use these databases to store some personal information and also hold sensitive financial information. Databases are used in e-commerce, finance and ERP systems. Basically, important business partner and

customer information is usually saved. The electronic data of most enterprises, organizations and government departments are stored in various databases. They

use these databases to store some personal information and also hold sensitive financial data. However, databases usually do not receive as much attention to security as operating systems and networks. Data is the lifeblood of enterprises and organizations, so choosing a secure database is crucial. Large websites generally use oracle or DB2, while most small and medium-sized websites use the more flexible and compact mssql database or mysql database. So, under the same conditions, which one is more secure, Microsoft's mssql or free mysql?

I installed mssql and mysql by default on my machine using the administrator account in order to
test their security under the same circumstances. My system configuration is as follows: operating system Microsoft windows 2000 Version5.0,
sp4, ftp service and iis service are installed, supporting asp and php. The system has only one administrator account, admin, and the guest
account is not disabled.

1. System internal security analysis


1.mysql database permission control issue

Mysql permission control is based on the mysql database, called The authorization table includes a total of six tables columns_priv, db, func, host, tables_priv and user. First use the desc user command to view the structure of the very important user table to query the content. Now you can view his permission settings. Use the command

select host,user,password,delete_priv,update_priv,drop_priv from user;

This command checks several dangerous permissions, and the displayed results are as follows:

mysql> select host,user,password,delete_priv,update_priv,drop_priv from user; 
+-----------+------+------------------+-------------+-------------+-----------+ 
| host | user | password | delete_priv | update_priv | drop_priv | 
+-----------+------+------------------+-------------+-------------+-----------+ 
| localhost | root |0e4941f53f6fa106 | Y | Y | Y | 
| % | root | | Y | Y | Y | 
| localhost | | | Y | Y | Y | 
| % | | | N | N | N | 
+-----------+------+------------------+-------------+-------------+-----------+ 
4 rows in set (0.00 sec)

The first one means using root to log in with the password on this machine. Have permissions to delete records, modify records, delete tables, etc.
Okay, this is safe. The second item means that you can use root to log in on any host without a password and have the permissions to delete records,
modify records, delete tables, etc. The third item indicates that you can log in anonymously on this machine and have the permissions to delete records, modify records, delete tables, etc. The last item indicates that you can log in anonymously from any host, but without any permissions.

Obviously, the second, third, and fourth are all unsafe! Needless to say, the second one, as for the third one, even if you have guest permissions locally, you can still log in to the mysql database and have full permissions. In this way, you can do whatever you want with the database

.
Solution: If you don't need remote maintenance, delete the second entry,

delete from user where 
host="%" and user="root";

or add a strong password to it. Delete the third article,

delete from 
user where host="localhost" and user="";

The above is the content of the security analysis of Mssql and Mysql. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!



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
php怎么连接mssql数据库php怎么连接mssql数据库Oct 23, 2023 pm 12:02 PM

php连接mssql数据库的方法有使用PHP的MSSQL扩展、使用PDO等。详细介绍:1、使用PHP的MSSQL扩展方法,确保PHP安装了MSSQL扩展。可以在PHP配置文件(php.ini)中检查是否启用了mssql扩展;2、使用PDO方法,确保PHP安装了PDO扩展。可以在PHP配置文件(php.ini)中检查是否启用了pdo_sqlsrv扩展。

Ubuntu安装PHP并配置MSSQL连接的详细指南Ubuntu安装PHP并配置MSSQL连接的详细指南Feb 29, 2024 am 11:15 AM

Ubuntu是一款流行的开源操作系统,常用于服务器运行。在Ubuntu上安装PHP并配置MSSQL连接是许多开发者和系统管理员经常需要做的操作之一。本文将为读者提供一份详细的指南,步骤包含安装PHP、设置Apache、安装MSSQLServer等内容,并附上具体的代码示例。第一步:安装PHP及相关扩展首先,我们需要安装PHP及其相关扩展,以便支持PHP连接

mysql怎么替换换行符mysql怎么替换换行符Apr 18, 2022 pm 03:14 PM

在mysql中,可以利用char()和REPLACE()函数来替换换行符;REPLACE()函数可以用新字符串替换列中的换行符,而换行符可使用“char(13)”来表示,语法为“replace(字段名,char(13),'新字符串') ”。

mysql的msi与zip版本有什么区别mysql的msi与zip版本有什么区别May 16, 2022 pm 04:33 PM

mysql的msi与zip版本的区别:1、zip包含的安装程序是一种主动安装,而msi包含的是被installer所用的安装文件以提交请求的方式安装;2、zip是一种数据压缩和文档存储的文件格式,msi是微软格式的安装包。

mysql怎么将varchar转换为int类型mysql怎么将varchar转换为int类型May 12, 2022 pm 04:51 PM

转换方法:1、利用cast函数,语法“select * from 表名 order by cast(字段名 as SIGNED)”;2、利用“select * from 表名 order by CONVERT(字段名,SIGNED)”语句。

MySQL复制技术之异步复制和半同步复制MySQL复制技术之异步复制和半同步复制Apr 25, 2022 pm 07:21 PM

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了关于MySQL复制技术的相关问题,包括了异步复制、半同步复制等等内容,下面一起来看一下,希望对大家有帮助。

Ubuntu环境下安装PHP支持MSSQL数据库的步骤详解Ubuntu环境下安装PHP支持MSSQL数据库的步骤详解Feb 29, 2024 am 10:39 AM

在Ubuntu环境下安装PHP支持MSSQL数据库的步骤详解在开发Web应用程序时,经常会遇到需要连接MicrosoftSQLServer(MSSQL)数据库的情况。在Ubuntu环境下,要实现PHP对MSSQL数据库的连接,需要安装相关的软件以及配置适当的设置。接下来,将详细介绍在Ubuntu环境下安装PHP支持MSSQL数据库的步骤,并提供具体的代码

带你把MySQL索引吃透了带你把MySQL索引吃透了Apr 22, 2022 am 11:48 AM

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了mysql高级篇的一些问题,包括了索引是什么、索引底层实现等等问题,下面一起来看一下,希望对大家有帮助。

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools