Mysql數據庫安全管理配置

?

1.刪除test庫

原因:

The default MySQL installation comes with a database named test that anyone can access. This database is intended only for tutorials, samples, testing, etc. Databases named "test" and also databases with names starting with - depending on platform - "test" or "test_" can be accessed by users that do not have explicit privileges granted to the database. You should avoid such database names on production servers.

?

建議:

Drop databases named "test" and also all databases with names starting with - depending on platform - "test" or "test_" and remove all associated privileges.

?

具體操作:在主庫上刪除test庫:

drop database test;

?

2. 刪除root用戶或者讓root用戶只可在本機登陸

原因:

The?root?User can log in remotely. It means that you can connect as?root?from remote hosts if you know the password. An attacker must guess the password, but may attempt to do so by connecting from remote hosts. However, if remote access is disallowed, the attacker can attempt to connect as the?root?user only after first gaining access to localhost.

?

The default MySQL installation includes a?root account with super (full) privileges that is used to administer the MySQL server. The name?root?is created by default and is very well known. The literal value?root?does not have any significance in the MySQL privilege system. Hence there is no requirement to continue with the user name?root.

?

建議:

a. rename the?root?mysql user to something obscure and disallow remote access (best for security).

b. if you still want to keep the?root?user for some reason, make sure remote access is disallowed. use the following sql: delete from mysql.user where user = "root" and host not in ('127.0.0.1','localhost',);flush privileges;

?

具體操作:

delete from mysql.user where user = "root" and host not in ('127.0.0.1','localhost',);

flush privileges;

?

在做刪除root用戶此步驟前需要依次確認 function、procedure、event、view、trigger的definer,如果有definer為root@%或root@xxx需要將之改為root@127.0.0.1或root@localhost,而且root@localhost或root@127.0.0.1需要被保留,除非將definer也改為其它。要不然在執行相應的定義時會拒絕執行。具體修改見《mysql如何修改所有的definer》

??

?3.最小化生產庫上的用戶權限

準備用common_user來聯接數據庫,保留root的本地登陸,授權一個具有dba權限的新帳戶:

grant insert,delete,update,select,execute on sp.* to 'common_user'@'127.0.0.1' identified by 'xxxxxx';

grant insert,delete,update,select,execute on sp.* to 'common_user'@'%' identified by 'xxxxxx';

grant all on *.* to ‘dba’@‘%’ identified by ‘xxxxxx’ with grant option;

flush privileges;

生產數據庫上只需要有如上的帳戶即可,其它的帳戶可根據需求再作修改。

?

至此,生產庫上的帳號管理權限安全配置告一段落。

?

轉載于:https://www.cnblogs.com/zejin2008/p/4766572.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/375591.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/375591.shtml
英文地址,請注明出處:http://en.pswp.cn/news/375591.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

duilib清空richedit內容

推薦使用以下方法: m_pRichEdit->SetSelAll(); m_pRichEdit->Clear();不推薦使用以下方法: m_pRichEdit->SetText("");雖然效果是一樣的,但是當編輯框中文本存在多種格式的時候,第二種方法會存在問題&#x…

新學了一個用python編寫的簡單的百度貼吧帖子的爬蟲

# -*- coding: utf-8 -*- #--------------------------------------- # 作者:chendn # 語言:Python 2.7.10 #---------------------------------------import string,urllib2 def tieba(url,beginPage,endPage):for i in range(beginPage,endPage1):…

duilib自定義消息

/** NOTE: All Message Numbers below 0x0400 are RESERVED.** Private Window Messages Start Here:*/ #define WM_USER 0x0400從WM_USER往上加就行了

BZOJ 2190儀仗隊【歐拉函數】

問題的唯一難點就是如何表示隊長能看到的人數?如果建系,隊長所在的點為(0,0)分析幾組數據就一目了然了,如果隊長能看到的點為(m,n),那么gcd(m,n)1即m n 互質或者是(0,1&a…

Codeforces Round #318 (Div. 2) B Bear and Three Musketeers (暴力)

算一下復雜度。發現可以直接暴。對于u枚舉a和b&#xff0c;判斷一下是否連邊&#xff0c;更新答案。 #include<bits/stdc.h> using namespace std;int n,m; const int maxn 4001; #define PB push_back vector<int> G[maxn]; bool g[maxn][maxn]; int deg[maxn]; …

form表單,submit,ajax提交

尼瑪... 一個簡單的表單提交&#xff0c;竟然給我整的直郁悶。 本來就是個保存功能&#xff0c;幾個前人都用的ajax提交&#xff0c;我也就沒改成submit。然后坑爹的就來了。 我在表單里寫了個<form></form>&#xff08;實際用ajax提交&#xff0c;也沒必要寫這個標…

windows 文件對話框

https://docs.microsoft.com/zh-cn/previous-versions/windows/desktop/legacy/bb776913(vvs.85)

python開發技術詳解(一)

python是一門簡單靈動的語言。從今天開始我要每天都做筆記&#xff0c;每天都要寫博客記錄我所想&#xff0c;我所學到的。 筆記提綱&#xff1a; 1&#xff0c;python的簡單介紹&#xff0c;python的編譯用法&#xff0c;有什么要注意的。 2&#xff0c;命名規則 3&#xff0c…

(Android Studio)添加文本框

此文大部分摘自http://hukai.me/android-training-course-in-chinese/basics/firstapp/building-ui.html android : id 這是定義View的唯一標識符。可以在程序代碼中通過該標識符對對象進行引用&#xff0c;例如對這個對象進行讀和修改的操作(在下一課里將會用到)。 當想從XML里…

java final keyword

依據上下文環境&#xff0c;java的keywordfinal也存在著細微的差別&#xff0c;但通常指的是“這是無法改變的。”不想改變的理由由兩種&#xff1a;一種是效率&#xff0c;還有一種是設計。因為兩個原因相差非常遠&#xff0c;所以關鍵子final可能被吳用。 接下來介紹一下使用…

聽GPT 講Rust源代碼--src/tools(24)

File: rust/src/tools/clippy/clippy_lints/src/types/borrowed_box.rs 在Rust源代碼中的rust/src/tools/clippy/clippy_lints/src/types/borrowed_box.rs文件是Clippy項目的一個規則&#xff0c;用于檢查可能是誤用或錯誤的Box引用情況。 Rust中的Box是一個堆分配的值的所有權…

遞歸乘法

遞歸乘法。 寫一個遞歸函數&#xff0c;不使用 * 運算符&#xff0c; 實現兩個正整數的相乘。可以使用加號、減號、位移&#xff0c;但要吝嗇一些。 示例1: 輸入&#xff1a;A 1, B 10輸出&#xff1a;10示例2: 輸入&#xff1a;A 3, B 4輸出&#xff1a;12提示: 保證乘法…

Building a RESTful Web Service

http://spring.io/guides/gs/rest-service/ Should shutdown tomcat service first , and then java -jar *.jar轉載于:https://www.cnblogs.com/churuosi/p/4774151.html

IOS的各種手勢

轉自http://blog.csdn.net/likendsl/article/details/7554150 一、概述 iPhone中處理觸摸屏的操作&#xff0c;在3.2之前是主要使用的是由UIResponder而來的如下4種方式&#xff1a; - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event - (void)touchesCancell…

duilib獲取字符串的像素長

CDuiString m_test_string _T("測試字符串")HDC m_hDc m_pm.GetPaintDC();// 100 是xml中配置的字體的編號HFONT hFont m_pm.GetFont(100);::SelectObject(m_hDc, hFont);SIZE size;GetTextExtentPoint32(m_hDc, m_test_string, i, &size);return size.cxThe …

(轉)rvm安裝與常用命令

rvm是一個命令行工具&#xff0c;可以提供一個便捷的多版本ruby環境的管理和切換。 https://rvm.io/ 如果你打算學習ruby/rails, rvm是必不可少的工具之一。 這里所有的命令都是再用戶權限下操作的&#xff0c;任何命令最好都不要用sudo. rvm安裝 $ curl -L get.rvm.io | bash …

Symfony2 EventDispatcher組件

一個插件系統中&#xff0c;A插件在不影響其它插件的前提下&#xff0c;添加新的方法&#xff0c;或者在一個方法運行前做一些準備工作&#xff0c;通過繼承來實現擴展是很不容易的&#xff0c;由于插件之間的關聯關系&#xff0c;A插件的改變也會使得關聯的插件被動的修改。Sy…

【轉】漫談ANN(2):BP神經網絡

上一次我們講了M-P模型&#xff0c;它實際上就是對單個神經元的一種建模&#xff0c;還不足以模擬人腦神經系統的功能。由這些人工神經元構建出來的網絡&#xff0c;才能夠具有學習、聯想、記憶和模式識別的能力。BP網絡就是一種簡單的人工神經網絡。我們的第二話就從BP神經網絡…

給定一個值S,在有序數組中找出兩個元素A和B,使 A+B = S.

在網上看到過一個面試題&#xff0c;感覺挺有意思&#xff0c;看別人的代碼寫的邏輯不夠謹慎&#xff0c;重寫了一個&#xff0c;較真了又。。。 package com.array7.algorithm;public class AlgorithmTest {public static void main(String[] args) {int[] arr {2 ,4 ,5 ,8 ,…