2017年05月31日

PostgreSQL10-beta ソースからコンパイルしてインストールする CentOS6.9 (成功)

CentOS 6.9 (64bit)

1. Firewall 5432 port をopen

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


2.
yum -y install gcc
yum -y install readline
yum -y install readline-devel
yum -y install zlib
yum -y install zlib-devel

3.
useradd postgres
passwd postgres


4.
chown -R postgres:postgres /home/postgres
chmod -R 700 /home/postgres
ls -ld  /home/postgres


5.

6.
ls
tar zxvf postgresql-10beta1.tar.gz
ls -d postgresql-10beta1

7.
mkdir /opt/postgresql10b1

8.
cd /usr/local/src/postgresql-10beta1
./configure --prefix=/opt/postgresql10b1


9.
make

10.
make install

11.
ls -l /opt/postgresql10b1

12.
chown -R postgres:postgres /opt/postgresql10b1
ls -l /opt/postgresql10b1

13.
vi /home/postgres/.bash_profile


15.
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
-------------------------------------------------------------------------------追記
POSTGRES_HOME=/opt/postgresql10b1

PGBIN=$POSTGRES_HOME/bin

PGLIB=$POSTGRES_HOME/lib

PGDATA==$POSTGRES_HOME/data

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PGLIB

PGPATH=$PATH:$HOME/bin:$PGBIN

export PATH

export PGDATA

export LD_LIBRARY_PATH

export POSTGRES_HOME=/opt/postgresql10b1
export PGBIN=$POSTGRES_HOME/bin
export PGLIB=$POSTGRES_HOME/lib
export PGDATA=$POSTGRES_HOME/data
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PGLIB
export PATH=$PGBIN:.:$PATHH
-------------------------------------------------------------------------------追記END


起動スクリプト


展開したPostgreSQLソース内にcontribディレクトリがあります。
contribディレクトリ内のstart-scriptsにlinuxというファイルが起動スクリプトの雛型になります。
このファイルをrootユーザで/etc/rc.d/init.d/にpostgresとファイル名を変更してコピーします。
インストール先は/opt/postgresql10b1なのでprefixに/opt/postgresql10b1を指定します。

chmod 755 /etc/init.d/postgres

chkconfig --add postgres
chkconfig --list | grep postgres
chkconfig postgres on


su - postgres
env | grep PGDATA
initdb --encoding=UTF8 --no-locale
initdb --encoding=UTF8 --locale=C



service postgres start

[root@localhost ~]# su - postgres
[postgres@localhost ~]$ psql

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

2017年05月30日

Firebird 3.0.2 (64bit) source install CentOS 7 [成功]

CentOS7.3.1611(64bit) / Firebird 3.0.2 (64bit) / source install

1. Firewall 3050port をopen

firewall-cmd --add-port=3050/tcp --zone=public --permanent
firewall-cmd --reload              //firewalldのリロード
 参照


2. yum
yum -y update
yum -y install libstdc++.so.5
yum -y install libstdc++.so.6
yum -y install libncurses.so.5

3. libtommathをinstall
cd /usr/local/src
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
yum -y install libtommath-devel

4. Firebird-3.0.2.32703-0.amd64.tar.gz  ( libtommathとbitを合わす)
cd /usr/local/src
wget https://sourceforge.net/projects/firebird/files/firebird-linux-amd64/3.0.2-Release/Firebird-3.0.2.32703-0.amd64.tar.gz
tar zxvf Firebird-3.0.2.32703-0.amd64.tar.gz
cd Firebird-3.0.2.32703-0.amd64
./install.sh

5.
chkconfig --list firebird
chkconfig  firebird on

service firebird stop
service firebird start

6.データ用フォルダの作成と権限
mkdir /var/fdb
chown -R firebird.firebird /var/fdb

7. ISQL
cd /opt/firebird/bin
./isql -u sysdba -p masterkey
CREATE DATABASE '/var/fdb/TEST1.FDB' page_size 8192  default character set utf8;
CREATE DATABASE '/var/fdb/TEST2.FDB' default character set utf8;
exit;
Screenshot from 2017-05-30 11-37-15.png


8.データベース作成後に再度権限
chown -R firebird.firebird /var/fdb


posted by a23 at 11:33| Comment(0) | Firebird

CentOS6 MySQL5.6


cd /usr/local/src
rpm -ihv mysql-community-release-el6-5.noarch.rpm
yum -y install mysql-community-server
chkconfig mysqld onservice mysqld start
mysql -uroot -p
SET PASSWORD FOR root@localhost=PASSWORD('password');
exit;



参照
/usr/bin/mysql_secure_installation


service mysql start
mysql -uroot -p
SET PASSWORD FOR root@localhost=PASSWORD('password');
exit;
mysql --version

mysql -uroot -pCreate Database testdb;
grant all privileges on *.* to usr1 identified by 'Passwd6';
FLUSH PRIVILEGES;
show grants;SHOW variables like 'character_set%';

find /* -name my*.cnf
gedit /etc/my.cnf

Create Database testdb CHRACTER SET utf8; <ー『データベース作成』
Drop Database test; <ー『 デフォルトのテストデータベース削除』
DMLユーザー(データ操作)
grant create,drop,alter,select,update,insert,delete on *.* to usr1 identified by 'mysql_password'; <ー『 ユーザーの

作成』
DDLユーザー(データ定義)
grant all privileges on *.* to usr10 identified by 'mysql_password'; <ー『 ユーザーの作成』

grant all privileges on table_name to usr10 identified by 'mysql_password'; <ー『 テーブル毎のユーザーの作成』

FLUSH PRIVILEGES;
show grants;

SHOW variables like 'character_set%';


show grants;SHOW variables like 'character_set%';




[client]
port=3306
default-character-set = utf8

[mysqld]
port=3306
skip-character-set-client-handshake
character-set-server = utf8
collation-server = utf8_general_ci
# init-connect = SET NAMES utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
# Server Id.
server-id=1
max_connections=151
query_cache_size=1M
table_open_cache=2000
tmp_table_size=57M
thread_cache_size=10
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=104M
key_buffer_size=8M
read_buffer_size=64K
read_rnd_buffer_size=256K
innodb_additional_mem_pool_size=8M
join_buffer_size=256K
max_allowed_packet=4M
max_connect_errors=100
open_files_limit=4161
query_cache_type=1
sort_buffer_size=256K


[mysqldump]
default-character-set = utf8

[mysql]
default-character-set = utf8


[mysqld]
default-character-set=utf8
default-storage-engine=INNODB
init_connect='SET autocommit=0'

datadir=/var/lib/mysql
tmpdir=/var/tmp/mysql
port=3306
socket=/var/lib/mysql/mysql.sock
max_connections=100
table_open_cache=2000
table_definition_cache=200
key_buffer_size=8M
read_buffer_size=128K
read_rnd_buffer_size=512K
join_buffer_size=256K
log_bin=mysql-bin
binlog_format=MIXED
max_binlog_size=64M
expire_logs_days=15
server_id=1
slow_query_log_file="MYSQL-slow.log"
long_query_time=5
log_queries_not_using_indexes
innodb_open_files=500
innodb_buffer_pool_size=1G
innodb_buffer_pool_instances=8
innodb_additional_mem_pool_size=4M
innodb_file_per_table=1
innodb_autoextend_increment=64M
innodb_log_files_in_group=2
innodb_log_file_size=48M
innodb_log_buffer_size=2M
innodb_flush_log_at_trx_commit=1
innodb_flush_method=O_DIRECT
innodb_thread_concurrency=16
innodb_commit_concurrency=10


innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_stats_on_metadata=0
innodb_checksum_algorithm=0
back_log=70
flush_time=0
join_buffer_size=256K
max_allowed_packet=4M
max_connect_errors=100
open_files_limit=4110
query_cache_type=1
sort_buffer_size=256K
table_definition_cache=1400
binlog_row_event_max_size=8K
sync_master_info=10000
sync_relay_log=10000
sync_relay_log_info=10000


# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー



posted by a23 at 07:04| Comment(0) | MySQL