DBシ哺ySQL

MySQL

繧、繝ウ繧ケ繝医シ繝ォ

MySQL繧、繝ウ繧ケ繝医シ繝ォ
# yum localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
# yum install mysql mysql-devel mysql-server mysql-utilities
蛻晄悄蛹
mysqld –user=mysql –initialize
蛻晄悄繝代せ繝ッ繝シ繝臥「コ隱
grep password /var/log/mysqld.log
MySQL蛻晄悄險ュ螳
# mysql_secure_installation
繝代せ繝ッ繝シ繝峨r險ュ螳壹@縺セ縺吶
MySQL閾ェ蜍戊オキ蜍戊ィュ螳
# chkconfig –level 3 mysqld on
MySQL繝舌シ繧ク繝ァ繝ウ遒コ隱
# mysql –version

險ュ螳

CakePHP3/髱樣寔邏繧ォ繝ゥ繝繧担ELECT縺ァ縺阪k讒倥↓縺吶k
窶サmy.cnf
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

謫堺ス

MySQL繝ュ繧ー繧、繝ウ
mysql -u root -p
邂。逅閠シ嗷oot縺ァ繝ュ繧ー繧、繝ウ
譌「蟄倥ョ繝シ繧ソ繝吶シ繧ケ荳隕ァ陦ィ遉コ
show databases;
繝繝シ繧ソ繝吶シ繧ケ菴懈
create database (繝繝シ繧ソ繝吶シ繧ケ蜷);
MySQL繝ュ繧ー繧「繧ヲ繝
exit
WEB繧オ繝シ繝舌シ縺ク謌サ繧翫∪縺吶
謫堺ス懷ッセ雎。繝繝シ繧ソ繝吶シ繧ケ謖螳
use (繝繝シ繧ソ繝吶シ繧ケ蜷)

phpMyAdmin

繝悶Λ繧ヲ繧カ縺九i驕髫疲桃菴懊〒縺阪k繝繝シ繧ソ繝吶シ繧ケ繧ス繝輔ヨ
CentOS縺ァ閾ェ螳繧オ繝シ繝舌シ讒狗ッ縲榊盾辣ァ

繧、繝ウ繧ケ繝医シ繝ォ
https://www.phpmyadmin.net/downloads/
縺ョ繝輔ぃ繧、繝ォ荳隕ァ縺九i縺九i譛譁ー繝舌シ繧ク繝ァ繝ウ縺ョURL繧偵さ繝斐シ
# wget https://files.phpmyadmin.net/phpMyAdmin/4.8.4/phpMyAdmin-4.8.4-all-languages.tar.gz
# tar xzvf phpMyAdmin-4.8.4-all-languages.tar.gz
# mv phpMyAdmin-4.8.4-all-languages /var/www/ス/phpMyAdmin
yum縺ァ繧、繝ウ繧ケ繝医シ繝ォ縺吶k縺ィ蜿、縺繝舌シ繧ク繝ァ繝ウ縺後う繝ウ繧ケ繝医シ繝ォ縺輔l繧(2018/12/16迴セ蝨ィ)
# yum –enablerepo=epel install -y phpMyAdmin
/etc/phpMyAdmin
/usr/share/phpMyAdmin
縺御ス懈舌&繧後k
php-mysql繧、繝ウ繧ケ繝医シ繝ォ遒コ隱
# rpm -q php-mysql
險ュ螳

險ュ螳壹ヵ繧。繧、繝ォ
/etc/phpMyAdmin/config.inc.php
險ュ螳壹ヵ繧。繧、繝ォ菴懈(蛻晏屓)
# cp config.sample.inc.php config.inc.php
繧、繝ウ繧ケ繝医シ繝ォ譎ゅョ繝繝輔か繝ォ繝郁ィュ螳壹ヵ繧。繧、繝ォ繧偵さ繝斐シ
繝代シ繝溘ャ繧キ繝ァ繝ウ螟画峩
# chmod 660 config.inc.php
謇譛芽螟画峩
# chown apache:apache config.inc.php
險ュ螳壹ヵ繧。繧、繝ォ螟画峩蜀螳ケ
$cfg[‘blowfish_secret’] = ”;

$cfg[‘blowfish_secret’] = ‘(繝代せ繝ッ繝シ繝)’;
霑ス蜉(譌・譛ャ隱槫喧)
$cfg[‘Lang’] = ‘ja-utf-8’;
phpMyAdmin逕ィApache險ュ螳壹ヵ繧。繧、繝ォ菴懈
# vi /etc/httpd/conf.d/phpmyadmin.conf
險ュ螳壼螳ケ
<Location /phpmyadmin>
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from 192.168.X
</Location>
證怜捷蛹匁ゥ溯ス諡。蠑オ
$ yum install php-mcrypt

Follow me!