2017年06月08日

CentOS6 MySQL5.1.73 (バンドル)

cat /etc/redhat-release
arch
mysql --version
00.png

サンプルを探す
find /* -name my*.cnf 
00.png
cat /etc/my.cnf
00.png
ls /usr/share/mysql/my*.cnf
00.png
/usr/share/mysql/my-huge.cnf
/usr/share/mysql/my-medium.cnf
/usr/share/mysql/my-innodb-heavy-4G.cnf
/usr/share/mysql/my-small.cnf
/usr/share/mysql/my-large.cnf

cp /usr/share/mysql/my-innodb-heavy-4G.cnf /etc/my.cnf

vi /etc/my.cnf
[client]
default-character-set = utf8
[mysqld]
character-set-server = utf8

service mysqld start
00.png


mysql_secure_installation
00.png
00.png

mysql -uroot -p
00.png

Create Database testdb;
grant all privileges on *.* to usr1 identified by 'Passwd6';
FLUSH PRIVILEGES;
show grants;
00.png

SHOW variables like 'character_set%';
00.png


vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
00.png
/etc/init.d/iptables restart
00.png












posted by a23 at 17:02| Comment(0) | MySQL

CentOS6 PostgreSQL8.4.20 (バンドル)

cat /etc/redhat-release
arch
 psql --version
01.png


cd /var/lib/pgsql
su postgres
initdb --encoding=UTF8 --locale=C --pgdata=/var/lib/pgsql/data
initdb --encoding=UTF8 --no-locale --pgdata=/var/lib/pgsql/data
01.png

postgres.conf  / pg_hba.conf
01.png


service postgresql start
01.png


vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp
01.png
/etc/init.d/iptables restart
01.png

su postgres
psql
\l
01.png








posted by a23 at 16:22| Comment(0) | PostgreSQL

CentOS7 MariaDB 5.5.52 → 10.1.24 アップグレード (バンドル)

CentOS7 にバンドルのMariaDB 5.5.52 を 10.1.24 アップグレード 

参考 CentOS7のMariaDB5.5を10.1にアップグレードする
http://qiita.com/egnr-in-6matroom/items/6dbb684ff03a228947bd


公式yumリポジトリ追加

/etc/yum.repos.d/MariaDB.repo
-------------------------------------------------------------------------------------
# MariaDB 10.1 CentOS repository list

[mariadb]
name = MariaDB
gpgcheck=1
-------------------------------------------------------------------------------------
サーバ停止
sudo systemctl stop mariadb
アッフデート
sudo yum update mariadb-server -y
Screenshot from 2017-06-09 10-46-12.png
Screenshot from 2017-06-09 10-49-31.png





find /* -name my*.cnf 
ls /usr/share/mysql/my*.cnf
Screenshot from 2017-06-09 10-49-31.png
/usr/share/mysql/my-huge.cnf
/usr/share/mysql/my-medium.cnf
/usr/share/mysql/my-innodb-heavy-4G.cnf
/usr/share/mysql/my-small.cnf
/usr/share/mysql/my-large.cnf

cp /usr/share/mysql/my-lage.cnf /etc/my.cnf.d/server.cnf
cp /usr/share/mysql/my-huge.cnf /etc/my.cnf.d/server.cnf
cp /usr/share/mysql/my-large.cnf /etc/my.cnf.d/server.cnf
cp /usr/share/mysql/my-innodb-heavy-4G.cnf /etc/my.cnf.d/server.cnf
Screenshot from 2017-06-09 10-53-04.png


vi /etc/my.cnf.d/server.cnf
Screenshot from 2017-06-09 10-54-09.png
[client]
default-character-set = utf8
[mysqld]
character-set-server = utf8
Screenshot from 2017-06-09 10-55-55.png

 
サーバ起動
sudo systemctl start mariadb
Screenshot from 2017-06-09 11-01-04.png

 
mysql_secure_installation
で、パスワード設定
Screenshot from 2017-06-09 11-01-52.png
Screenshot from 2017-06-09 11-02-27.png





 
mysql -u root -p
Screenshot from 2017-06-08 15-53-30.png
Show variables like 'character_set%';
Screenshot from 2017-06-08 15-54-17.png

Create Database testdb;
grant all privileges on *.* to usr1 identified by 'Passwd6';
FLUSH PRIVILEGES;
exit
Screenshot from 2017-06-08 15-56-28.png



 


posted by a23 at 13:44| Comment(0) | MySQL

CentOS7 PostgreSQL9.2.18 (バンドル)

cat /etc/redhat-release
arch
 psql --version
Screenshot from 2017-06-07 14-15-34.png


postgresql-setup initdb


Screenshot from 2017-06-08 11-58-18.png




systemctl start postgresql.service
su postgres
psql

psql: サーバに接続できませんでした: そのようなファイルやディレクトリはありません
                              ローカルにサーバが稼動していますか?
                              Unixドメインソケット"/var/run/postgresql/.s.PGSQL.5432"で通信を受け付けていますか?
Screenshot from 2017-06-08 12-41-15.png




systemctl start postgresql.service
su postgres

psql
\l
Screenshot from 2017-06-08 12-44-47.png





Firewall 5432 port をopen
firewall-cmd --add-port=5432/tcp --zone=public --permanent
firewall-cmd --reload            
posted by a23 at 12:36| Comment(0) | PostgreSQL