Home Database Mysql Tutorial 六大步保护MySQL数据库中重要数据_MySQL

六大步保护MySQL数据库中重要数据_MySQL

Jun 01, 2016 pm 02:03 PM
mysql Protect install data database server user important

与自动的数据库备份不同,对系统管理员来说,保护数据免受未授权用户的侵犯需要采取一定的行动。如果你用的是MySQL,就可以使用一些方便的功能来保护系统,来大大减少机密数据被未授权用户访问的风险。 I=}h">I  
'bX`7|9Y9  
企业最有价值的资产通常是其数据库中的客户或产品信息。因此,在这些企业中,数据库管理的一个重要部分就是保护这些数据免受外部攻击,及修复软/硬件故障。 w*El[`1^v  
Z^)|z  
在大多数情况下,软硬件故障通过数据备份机制来处理。多数数据库都自带有内置的工具自动完成整个过程,所以这方面的工作相对轻松,也不会出错。但麻烦却来自另一面:阻止外来黑客入侵窃取或破坏数据库中的信息。不幸的是,一般没有自动工具解决这一问题;而且,这需要管理员手工设置障碍来阻止黑客,确保公司数据的安全。 QE/i+04{  
8E @Oze)  
不对数据库进行保护的常见原因是由于这一工作“麻烦”而“复杂”。这确实是事实,但如果你应用MySQL,就可以使用一些方便的功能来显著减少面临的风险。下面列出了六项功能: p@I*7V#u  
+s $]']  
第一步:删除授权表中的通配符 F)#G~d>=  
:QLnJyn  
MySQL访问控制系统通过一系列所谓的授权表运行,从而对数据库、表格或栏目级别的用户访问权利进行定义。但这些表格允许管理员为一名用户设定一揽子许可,或一组应用通配符的表格。这样做会有潜在的危险,因为黑客可能会利用一个受限的账户来访问系统的其他部分。由于这一原因,在设置用户特权时要谨慎,始终保证用户只能访问他们所需的内容。在给个别用户设定超级特权时要尤其小心,因为这种级别允许普通用户修改服务器的基本配置,并访问整个数据库。 Y*ckR.  
.#3s 
建议:对每个用户账户应用显示特权命令,以审查授权表,了解应用通配符许可是否恰当。 W{u1GkWV  
d~BE4?  
第二步:要求使用安全密码 5H`zg_o[  
{40NTUT{  
用户账号的安全与用来保护它们的密码密切相关。因此,在安装MySQL时第一件事就应该设置MySQL根账号的密码(默认为空)。修复这一漏洞后,接下来就应要求每个用户账号使用一个密码,且不要使用生日、用户名或字典中的单词这些容易识别的启发式密码。 M>iIOEzr  
.M^seNlqA/  
建议:应用MySQL-安全-授权选项避免使用旧的,不大安全的MySQL密码格式。 F)+ 6vm  
UXU$6^_  
第三步:检查配置文件许可 JknJu|JQf}  
oG?;%o 
一般来说,要使服务器连接更为快速方便,单个用户和服务器管理员必须把他们的用户账号密码存储在单用户MySQL选项文件中。但是,这种密码是以纯文本形式存储在文件中的,很容易就可以查阅。因此,必须保证这样的单用户配置文件不被系统中的其他用户查阅,且将它存储在非公共的位置。理想情况下,你希望单用户配置文件保存在用户的根目录,许可为0600。 {@j1V b0*  
r!UL/O!->  
第四步:加密客户与服务器之间数据传送 :5 P{]@/  
XbU2x#(t  
MySQL(及其它)客户与服务器构架的一个重要问题就是通过网络传送数据时的安全问题。如果客户与服务器间的交互以纯文本形式发生,黑客就可能“嗅出”被传送的数据包,从而获得机密信息。你可以通过激活MySQL配置中的SSL,或应用一个OpenSSH这样的安全应用来为传送的数据建立一个安全的加密“通道”,以关闭这一漏洞。以这种形式加密客户与服务器连接可使未授权用户极难查阅往来的数据。 "{&KQb*:&  
yzk9k [^  
第五步:禁止远程访问 C;4pE>ce  
=>p|\4mx  
如果用户不需要远程访问服务器,你可以迫使所有MySQL连接通过UNIX插槽文件来完成,从而大大减少网络受攻击的风险。这一过程可通过跳过网络选项启动服务器来完成。这样可以阻止TCP/IP网络连接到MySQL上,保证没有用户可以远程连接系统。 Yg0g2mX=  
p^p2JK2gL  
建议:可以在MySQL服务器配置中添加捆绑地址127.0.0.1指令来增强这一功能,迫使MySQL捆绑当地机器的IP地址来保证只有同一系统中的用户可以连接到MySQL。 jusHbB/h  
3io=\A&  
第六步:积极监控MySQL访问记录
iC6o9c]i;?  
se/F?tOb  
MySQL带有许多不同的日志文件,它们记录客户连接,查询和服务器错误。其中,最重要的是一般查询日志,它用时间标签记录每名客户的连接和中断时间,并记录客户执行的每个查询。如果你怀疑发生了不寻常的行为,如网络入侵,那么监控这个日志以了解行为的来源是个好方法。 Wd]w  
aX+=M?6p  
保护你的MySQL数据库是一个日常工作。因此,即使完成了上述步骤,你也不应松懈,了解更多安全建议,积极监控并更新系统安全。

Statement of this Website
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

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 ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to optimize MySQL query performance in PHP? How to optimize MySQL query performance in PHP? Jun 03, 2024 pm 08:11 PM

MySQL query performance can be optimized by building indexes that reduce lookup time from linear complexity to logarithmic complexity. Use PreparedStatements to prevent SQL injection and improve query performance. Limit query results and reduce the amount of data processed by the server. Optimize join queries, including using appropriate join types, creating indexes, and considering using subqueries. Analyze queries to identify bottlenecks; use caching to reduce database load; optimize PHP code to minimize overhead.

How to create a MySQL table using PHP? How to create a MySQL table using PHP? Jun 04, 2024 pm 01:57 PM

Creating a MySQL table using PHP requires the following steps: Connect to the database. Create the database if it does not exist. Select a database. Create table. Execute the query. Close the connection.

How to fix mysql_native_password not loaded errors on MySQL 8.4 How to fix mysql_native_password not loaded errors on MySQL 8.4 Dec 09, 2024 am 11:42 AM

One of the major changes introduced in MySQL 8.4 (the latest LTS release as of 2024) is that the "MySQL Native Password" plugin is no longer enabled by default. Further, MySQL 9.0 removes this plugin completely. This change affects PHP and other app

70B model generates 1,000 tokens in seconds, code rewriting surpasses GPT-4o, from the Cursor team, a code artifact invested by OpenAI 70B model generates 1,000 tokens in seconds, code rewriting surpasses GPT-4o, from the Cursor team, a code artifact invested by OpenAI Jun 13, 2024 pm 03:47 PM

70B model, 1000 tokens can be generated in seconds, which translates into nearly 4000 characters! The researchers fine-tuned Llama3 and introduced an acceleration algorithm. Compared with the native version, the speed is 13 times faster! Not only is it fast, its performance on code rewriting tasks even surpasses GPT-4o. This achievement comes from anysphere, the team behind the popular AI programming artifact Cursor, and OpenAI also participated in the investment. You must know that on Groq, a well-known fast inference acceleration framework, the inference speed of 70BLlama3 is only more than 300 tokens per second. With the speed of Cursor, it can be said that it achieves near-instant complete code file editing. Some people call it a good guy, if you put Curs

AI startups collectively switched jobs to OpenAI, and the security team regrouped after Ilya left! AI startups collectively switched jobs to OpenAI, and the security team regrouped after Ilya left! Jun 08, 2024 pm 01:00 PM

Last week, amid the internal wave of resignations and external criticism, OpenAI was plagued by internal and external troubles: - The infringement of the widow sister sparked global heated discussions - Employees signing "overlord clauses" were exposed one after another - Netizens listed Ultraman's "seven deadly sins" Rumors refuting: According to leaked information and documents obtained by Vox, OpenAI’s senior leadership, including Altman, was well aware of these equity recovery provisions and signed off on them. In addition, there is a serious and urgent issue facing OpenAI - AI safety. The recent departures of five security-related employees, including two of its most prominent employees, and the dissolution of the "Super Alignment" team have once again put OpenAI's security issues in the spotlight. Fortune magazine reported that OpenA

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

How to handle database connection errors in PHP How to handle database connection errors in PHP Jun 05, 2024 pm 02:16 PM

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

See all articles