MariaDB(Mysql) DB ์„œ๋น„์Šค ์ค‘์ง€
~# systemctl stop mysql

/var/lib/mysql ํด๋”๋ฅผ /home/mysql ์œผ๋กœ ์ด๋™
~# mv /var/lib/mysql /home/mysql

/home/mysql์˜ ์†Œ์œ ์ž ๋ณ€๊ฒฝ
~# chown -R mysql.mysql /home/mysql 
~# chmod 700 /home/mysql

/var/lib ์— ์‹ฌ๋ณผ๋ฆญ ๋งํฌ ์ƒ์„ฑ
~# ln -sf /home/mysql /var/lib/mysql

/usr/share/mysql/mysql.server ํŒŒ์ผ ์ˆ˜์ •
~# vi /usr/share/mysql/mysql.server
47ํ–‰์˜ datadir= ์„ datadir=/home/mysql ๋กœ ์„ค์ •

/var/lib/mysql ์˜ ๋””ํดํŠธ ๋ ˆ์ด๋ธ” ์ˆ˜์ • -SELinux-
~# semanage fcontext -a -t mysqld_db_t โ€˜/var/lib/mysqlโ€™
~# restorecon -v โ€˜/var/lib/mysqlโ€™

semange๊ฐ€ ์—†์„๊ฒฝ์šฐ yum install policycoreutils-python ๋กœ ์„ค์น˜

/home/mysql ์˜ ๋””ํดํŠธ ๋ ˆ์ด๋ธ” ๋ณ€๊ฒฝ -SELinux-
~# semanage fcontext -a -t mysqld_db_t โ€˜/home/mysql;
~# restorecon -v โ€˜/home/mysqlโ€™

MaraiDB(Mysql) DB ์„œ๋น„์Šค ์žฌ์‹œ์ž‘
~# systemctl restart mysql

'๋ฆฌ๋ˆ…์Šค > MYSQL' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

mysql root ๊ณ„์ • ๋ณ€๊ฒฝ  (0) 2016.07.10
SQL INJECTION ๊ณต๊ฒฉ ์ˆ˜์ • ์ฟผ๋ฆฌ๋ฌธ  (0) 2016.06.16

๋ธ”๋กœ๊ทธ ์ด๋ฏธ์ง€

extron

๋ชจ๋ฐ”์ผ+IT

,