Home Database Mysql Tutorial 让风险远离 保护MySQL中的重要数据

让风险远离 保护MySQL中的重要数据

Jun 07, 2016 pm 04:09 PM
mysql Protect technology data important along with risk

随着技术的进步, MySQL等开源数据库似乎也开始受到企业的热捧 。数据库对于企业的重要性是不言而喻的,其数据库管理的一个重要部分就是保护这些数据免受外部攻击,及修复软/硬件故障。在大多数情况下,软硬件故障通过数据备份机制来处理。 多数数据库都自带

随着技术的进步,MySQL等开源数据库似乎也开始受到企业的热捧。数据库对于企业的重要性是不言而喻的,其数据库管理的一个重要部分就是保护这些数据免受外部攻击,及修复软/硬件故障。在大多数情况下,软硬件故障通过数据备份机制来处理。

多数数据库都自带有内置的工具自动完成整个过程,所以这方面的工作相对轻松,也不会出错。但麻烦却来自另一面:阻止外来黑客入侵窃取或破坏数据库中的信息。不幸的是,一般没有自动工具解决这一问题;而且,这需要管理员手工设置障碍来阻止黑客,确保公司数据的安全。

不对数据库进行保护的常见原因是由于这一工作“麻烦”而“复杂”。这确实是事实,但如果你应用MySQL,就可以使用一些方便的功能来显着减少面临的风险。下面列出了以下几个功能:

◆删除授权表中的通配符

MySQL访问控制系统通过一系列所谓的授权表运行,从而对数据库、表格或栏目级别的用户访问权利进行定义。但这些表格允许管理员为一名用户设定一揽子许可,或一组应用通配符的表格。这样做会有潜在的危险,因为黑客可能会利用一个受限的账户来访问系统的其他部分。由于这一原因,在设置用户特权时要谨慎,始终保证用户只能访问他们所需的内容。在给个别用户设定超级特权时要尤其小心,因为这种级别允许普通用户修改服务器的基本配置,并访问整个数据库。

建议:对每个用户账户应用显示特权命令,以审查授权表,了解应用通配符许可是否恰当。

◆要求使用安全密码

用户账号的安全与用来保护它们的密码密切相关。因此,在安装MySQL时第一件事就应该设置MySQL根账号的密码(默认为空)。修复这一漏洞后,接下来就应要求每个用户账号使用一个密码,且不要使用生日、用户名或字典中的单词这些容易识别的启发式密码。

建议:应用MySQL-安全-授权选项避免使用旧的,不大安全的MySQL密码格式。

◆检查配置文件许可

一般来说,要使服务器连接更为快速方便,单个用户和服务器管理员必须把他们的用户账号密码存储在单用户MySQL选项文件中。但是,这种密码是以纯文本形式存储在文件中的,很容易就可以查阅。因此,必须保证这样的单用户配置文件不被系统中的其他用户查阅,且将它存储在非公共的位置。理想情况下,你希望单用户配置文件保存在用户的根目录,许可为0600。

◆加密客户与服务器之间数据传送

MySQL(及其它)客户与服务器构架的一个重要问题就是通过网络传送数据时的安全问题。如果客户与服务器间的交互以纯文本形式发生,黑客就可能“嗅出”被传送的数据包,从而获得机密信息。你可以通过激活MySQL配置中的SSL,或应用一个OpenSSH这样的安全应用来为传送的数据建立一个安全的加密“通道”,以关闭这一漏洞。以这种形式加密客户与服务器连接可使未授权用户极难查阅往来的数据。

◆禁止远程访问

如果用户不需要远程访问服务器,你可以迫使所有MySQL连接通过UNIX插槽文件来完成,从而大大减少网络受攻击的风险。这一过程可通过跳过网络选项启动服务器来完成。这样可以阻止TCP/IP网络连接到MySQL上,保证没有用户可以远程连接系统。

建议:可以在MySQL服务器配置中添加捆绑地址127.0.0.1指令来增强这一功能,迫使MySQL捆绑当地机器的IP地址来保证只有同一系统中的用户可以连接到MySQL。

◆积极监控MySQL访问记录

MySQL中带有很多不同的日志文件,它们记录客户连接,查询和服务器错误。其中,最重要的是一般查询日志,它用时间标签记录每名客户的连接和中断时间,并记录客户执行的每个查询。如果你怀疑发生了不寻常的行为,如网络入侵,那么监控这个日志以了解行为的来源是个好方法,保护你的MySQL数据库是一个日常工作。因此,即使完成了上述步骤,也还需要你利用更多的时间去了解更多的安全建议,积极监控并更新你的系统安全。

本文来自爱上简单的博客,

原文地址:http://blog.csdn.net/zz198811/archive/2010/03/07/5353319.aspx


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 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks 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 use MySQL backup and restore in PHP? How to use MySQL backup and restore in PHP? Jun 03, 2024 pm 12:19 PM

Backing up and restoring a MySQL database in PHP can be achieved by following these steps: Back up the database: Use the mysqldump command to dump the database into a SQL file. Restore database: Use the mysql command to restore the database from SQL files.

How to insert data into a MySQL table using PHP? How to insert data into a MySQL table using PHP? Jun 02, 2024 pm 02:26 PM

How to insert data into MySQL table? Connect to the database: Use mysqli to establish a connection to the database. Prepare the SQL query: Write an INSERT statement to specify the columns and values ​​to be inserted. Execute query: Use the query() method to execute the insertion query. If successful, a confirmation message will be output.

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

How to use MySQL stored procedures in PHP? How to use MySQL stored procedures in PHP? Jun 02, 2024 pm 02:13 PM

To use MySQL stored procedures in PHP: Use PDO or the MySQLi extension to connect to a MySQL database. Prepare the statement to call the stored procedure. Execute the stored procedure. Process the result set (if the stored procedure returns results). Close the database connection.

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

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.

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

See all articles