滲透測試基礎知識----MySQL 配置
MySQL 配置
1、建立mysql執行使用的使用者mysql
$ /usr/sbin/groupadd mysql$ /usr/sbin/useradd -g mysql mysql
2、建立binlog和庫的儲存路徑並賦予mysql使用者許可權
$ mkdir -p /usr/local/webserver/mysql/binlog /www/data_mysql$ chown mysql.mysql /usr/local/webserver/mysql/binlog/ /www/data_mysql/
3、建立my.cnf配置檔案
將/etc/my.cnf替換為下面內容
$ cat /etc/my.cnf[client]port = 3306socket = /tmp/mysql.sock[mysqld]replicate-ignore-db = mysqlreplicate-ignore-db = testreplicate-ignore-db = information_schemauser = mysqlport = 3306socket = /tmp/mysql.sockbasedir = /usr/local/webserver/mysqldatadir = /www/data_mysqllog-error = /usr/local/webserver/mysql/mysql_error.logpid-file = /usr/local/webserver/mysql/mysql.pidopen_files_limit = 65535back_log = 600max_connections = 5000max_connect_errors = 1000table_open_cache = 1024external-locking = FALSEmax_allowed_packet = 32Msort_buffer_size = 1Mjoin_buffer_size = 1Mthread_cache_size = 600#thread_concurrency = 8query_cache_size = 128Mquery_cache_limit = 2Mquery_cache_min_res_unit = 2kdefault-storage-engine = MyISAMdefault-tmp-storage-engine=MYISAMthread_stack = 192Ktransaction_isolation = READ-COMMITTEDtmp_table_size = 128Mmax_heap_table_size = 128Mlog-slave-updateslog-bin = /usr/local/webserver/mysql/binlog/binlogbinlog-do-db=oa_fbbinlog-ignore-db=mysqlbinlog_cache_size = 4Mbinlog_format = MIXEDmax_binlog_cache_size = 8Mmax_binlog_size = 1Grelay-log-index = /usr/local/webserver/mysql/relaylog/relaylogrelay-log-info-file = /usr/local/webserver/mysql/relaylog/relaylogrelay-log = /usr/local/webserver/mysql/relaylog/relaylogexpire_logs_days = 10key_buffer_size = 256Mread_buffer_size = 1Mread_rnd_buffer_size = 16Mbulk_insert_buffer_size = 64Mmyisam_sort_buffer_size = 128Mmyisam_max_sort_file_size = 10Gmyisam_repair_threads = 1myisam_recoverinteractive_timeout = 120wait_timeout = 120skip-name-resolve#master-connect-retry = 10slave-skip-errors = 1032,1062,126,1114,1146,1048,1396#master-host = 192.168.1.2#master-user = username#master-password = password#master-port = 3306server-id = 1loose-innodb-trx=0loose-innodb-locks=0loose-innodb-lock-waits=0loose-innodb-cmp=0loose-innodb-cmp-per-index=0loose-innodb-cmp-per-index-reset=0loose-innodb-cmp-reset=0loose-innodb-cmpmem=0loose-innodb-cmpmem-reset=0loose-innodb-buffer-page=0loose-innodb-buffer-page-lru=0loose-innodb-buffer-pool-stats=0loose-innodb-metrics=0loose-innodb-ft-default-stopword=0loose-innodb-ft-inserted=0loose-innodb-ft-deleted=0loose-innodb-ft-being-deleted=0loose-innodb-ft-config=0loose-innodb-ft-index-cache=0loose-innodb-ft-index-table=0loose-innodb-sys-tables=0loose-innodb-sys-tablestats=0loose-innodb-sys-indexes=0loose-innodb-sys-columns=0loose-innodb-sys-fields=0loose-innodb-sys-foreign=0loose-innodb-sys-foreign-cols=0slow_query_log_file=/usr/local/webserver/mysql/mysql_slow.loglong_query_time = 1[mysqldump]quickmax_allowed_packet = 32M
4、初始化資料庫
$/usr/local/webserver/mysql/scripts/mysql_install_db --defaults-file=/etc/my.cnf --user=mysql
5、建立開機啟動指令碼
$ cd /usr/local/webserver/mysql/$ cp support-files/mysql.server /etc/rc.d/init.d/mysqld$ chkconfig --add mysqld$ chkconfig --level 35 mysqld on
6、啟動mysql伺服器
更改許可權chown -R mysql.mysql /usr/local/webserver/mysql/啟動服務$ service mysqld start
7、其他命令
啟動:service mysqld start停止:service mysqld stop重啟:service mysqld restart過載配置:service mysqld reload
8、連線Mysql
#預設空密碼/usr/local/webserver/mysql/bin/mysql -u root -p
修改mysql密碼:
/usr/local/webserver/mysql/bin/mysqladmin -uroot -p password
或者進行mysql命令列修改:
SET PASSWORD FOR '使用者名稱'@'主機' = PASSWORD(‘密碼');
建立用並授權:
grant all privileges on *.* to 使用者名稱@'%' identified by '密碼' with grant option;
最後重新整理許可權:
flush privileges ;
*本文章僅供技術交流分享,請勿做未授權違法攻擊,雨筍教育不負任何責任。具體請參考《網路安全法》。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70006652/viewspace-2871720/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 滲透測試基礎知識---nginx安全配置Nginx
- 滲透測試基礎知識---mysql配置檔案詳解MySql
- 網站安全公司 滲透測試基礎知識點大全網站
- 軟體滲透測試基礎知識分享,可做滲透測試的軟體檢測公司有哪些?
- 物理滲透測試基礎
- 內網滲透測試基礎內網
- 滲透測試(PenTest)基礎指南
- WEB網路滲透的基礎知識Web
- metasploit 滲透測試筆記(基礎篇)筆記
- 滲透測試基礎--內網轉發內網
- 【1】測試基礎知識
- Web測試基礎-Html基礎知識WebHTML
- 滲透測試網站安全基礎點講解網站
- 15道基礎滲透測試面試題,附答案!面試題
- 軟體測試基礎知識
- 介面測試--基礎小知識
- 介面測試之基礎知識
- 滲透測試工具方法基礎程式碼審計篇
- 滲透測試會用到哪些工具?滲透測試教程
- 滲透測試系統kali配置源
- 效能測試基礎知識體系
- 域滲透前置知識
- 效能測試必備基礎知識(二)
- 軟體效能測試基礎知識分享
- 誰來教我滲透測試——黑客應該掌握的Windows基礎黑客Windows
- Linux滲透測試Linux
- Metasploit滲透測試指南
- 滲透測試-資訊收集
- 滲透測試報告測試報告
- 【滲透測試】Vulnhub DarkHole
- MySql基礎知識(2)MySql
- MySQL基礎知識(全)MySql
- MySQL基礎知識(5)MySql
- MySQL基礎知識(7)MySql
- MySQL基礎知識(8)MySql
- MySQL基礎知識(6)MySql
- 網路安全滲透測試的型別!滲透測試入門教程型別
- 滲透測試什麼?滲透測試具體操作流程是什麼