Obtaining the value of column that uses AUTO_INCREMENT after an INSERT statement can be achieved in a number of different ways. To obtain the value immediately after an INSERT, use a SELECT query with the LAST_INSERT_ID() function.

For example, using Connector/ODBC you would execute two separate statements, the INSERT statement and the SELECT query to obtain the auto-increment value.

INSERT INTO tbl (auto,text) VALUES(NULL,'text');

If you do not require the value within your application, but do require the value as part of another INSERT, the entire process can be handled by executing the following statements:

INSERT INTO tbl (auto,text) VALUES(NULL,'text');
INSERT INTO tbl2 (id,text) VALUES(LAST_INSERT_ID(),'text');

Certain ODBC applications (including Delphi and Access) may have trouble obtaining the auto-increment value using the previous examples. In this case, try the following statement as an alternative:


This alternative method requires that sql_auto_is_null variable is not set to 0. See Server System Variables.

See also How to Get the Unique ID for the Last Inserted Row.

Reference : https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-usagenotes-functionality-last-insert-id.html

저작자 표시

Comment +0

Roundcube is a web browser based mail client & also known as webmail. It provides a GUI ( Graphical User Interface ) where end users can check their mails, can create & manage folders, can use address book to search email ids and lot of other webmail features.

To install roundcube on CentOS 7 followings are the prerequisite that should be installed.

  • PHP
  • Database ( MariaDB or MySQL )
  • Web Server ( Apache )
  • Any MTA – Postfix , Sendmail & Qmail

In My Case i have already installed Postfix with dovecot on CentOS 7 with

  • Domain name = nsitmail.com
  • Hostname = tec.nsitmail.com

Follow below Steps to install & configure latest version of Roundcube :

Step:1 Install PHP , Database & Apache using below command :

[root@tec ~]# yum install httpd php php-common php-json php-xml php-mbstring php-imap php-pear-DB php-mysql mysql mariadb-server

Once the above package list is installed , set the time zone value in PHP .

root@tec ~]# vi /etc/php.ini
date.timezone = Asia/Kolkata

Save & exit the file

Step:2 Create & Configure Roundcube Database

Let us first set the Initial settings & root password of Mariadb Server :

[root@tec ~]# systemctl start mariadb
[root@tec ~]# systemctl enable mariadb
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service'
[root@tec ~]#
[root@tec ~]# mysql_secure_installation

Above Command “mysql_secure_installation” will allow us to set root password , remove anonymous users , disable remote root login and will remove test database.

Now Create database for Roundube and grant all the permissions to the database


Step:3 Download tar file of Roundcube

Download latest version of Roundcube tar file either from their official site “https://roundcube.net/download/” or we can use below wget command.

[root@tec ~]# wget http://nchc.dl.sourceforge.net/project/roundcubemail/roundcubemail/1.1.3/roundcubemail-1.1.3-complete.tar.gz

Untar the downloaded file in your web server document root.

[root@tec ~]# tar -zxpvf roundcubemail-1.1.3-complete.tar.gz -C /var/www/html/

Rename the extracted file as Roundcube and set the required permissions

[root@tec html]# mv roundcubemail-1.1.3 roundcube
[root@tec html]# chown apache:apache roundcube
[root@tec html]#

Start the Apache service

[root@tec html]# systemctl start httpd
[root@tec html]# systemctl enable httpd
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
[root@tec html]#

Step:4 Start Roundcube installation using web browser installer.

To start the installation of Rouncube , access the below url in the web browser



click on Next…

Define the Database, Authentication Mechanism, SMTP & IMAP setting in this step. When We click on Create Config option it will ask us to Copy or download the configuration and save it as config.inc.php within the /var/www/html/roundcube/config/ directory of your Roundcube installation.

In my case i am using http based authentication mechanism , so i create one user on my Linux box and set its password using htpasswd command .

[root@tec ~]# htpasswd -c /home/linuxtechi/.htpasswd linuxtechi
New password:
Re-type new password:
Adding password for user linuxtechi
[root@tec ~]#




Remove the installer directory from your web server document root ( /var/www/html/roundcube )

[root@tec ~]# cd /var/www/html/roundcube/
[root@tec roundcube]# rm -rf installer
[root@tec roundcube]#

Step:5 Now access your account using Roundcube

Open the url in the browser “http://tec.nsitmail.com/roundcube/” , use the credentials that we set using htpasswd command.



Roundcube installation is completed, Now explore it and enjoy.

출처 : https://www.linuxtechi.com/install-latest-version-of-roundcube-centos-7/

저작자 표시

Comment +0


Skill/BigData2017.03.02 18:00


대규모 분산 시스템의 성능을 분석하고 문제를 진단, 처리하는 java 플랫폼.

네이버에서 2012년 7월 부터 개발을 시작하여 14년 말에 배포하였다.

(PINPOINT 뜻 : 원인을 콕! 집어내다)


 1. 서버 맵 - 대상 서버와 연결된 다른 서버와의 관계 다이어그램

 2. 스캐터 - 요청별 응답시간에 따른 그래프

 3. request detail - 스캐터에서 선택된 요청의 스택트레이스 뷰

 4. 에러 발생 요청 표시 - 에러가 발생한 요청 빨간색으로 표시

 5. 서버의 jar목록 표시 - 서버에 접속하지 않아도 관련된 jar 목록 확인 가능


 1. DB - HBase(하둡 분산 데이터베이스 기반)

 2. Web UI로 view적으로 보여줌

 3. Collector - Web UI를 보여주는것을 쌓아두는거 , 대상이 되는 타겟 서버의 정보를 HBase가 저장함

 4. Agent - 각각의 대상 서버에 pinpoint agent를 줘서 각각의 pinpoint agent가 collector의 데이터를
    udp/tcp + thrift를 통해서 보내주고 그걸로 디비에 저장하고 그걸 web ui가 보여줌


- 분산 트랜잭션 추적

- 토플로지 다오 발견

- 수평 확장성

- 코드 수준의 가시성

요청/반응 분석 차트

실시간 트래픽 차트

콜 스택 트리(여러 대의 서버를 한번에 볼 수 있다.)

인스펙터(JVM 힙상태 등 여러개 확인 가능)

도입 전 사전 확인

애플리케이션 환경 확인(java version, framework & lib, was 등)

도입 과정에서 고민했던 내용

HBase 이중화? 샤딩? Hadoop? 구성을 해야하는 가?

(핀 포인트 데이터의 경우 실 서버 데이터가 아니라 날라가도 문제 없다고 판단했기 때문에)

출처 : https://yangbongsoo.gitbooks.io/study/content/pinpoint.html

   <기초적이지만, 제법 괜찮은 자료들이 많습니다>

저작자 표시

Comment +0

윈도우로 개발을 계속하다 보니 윈도우가 편할 수 밖에 없다.

맥을 이용하여 간지나게 개발하려 하였는데 자료도 많지 않고 해서 멋진 노트북을 구매하였다. 

고 사양의 인스피론으로 하지만.. 맷블랙? 재질이라 먼지가 너무 낀다.

뭐 각설하고, 프로그램을 좀 정리해서 보여주고 싶었다.

가장 많이 쓰는 Fences 또 대체 할 만한 Nimi Places 아래 블로그를 통해서 비교가 잘되어 있다.


그리고 나는 아래 사이트를 통해서 다운 받았다.



'Skill > Windows' 카테고리의 다른 글

바탕화면 정리 프로그램  (0) 2017.02.02
[Windows] 프로세스 kill  (0) 2014.09.15

Comment +0

After a long wait, finally Java SE Development Kit 8 is available to download. JDK 8 has been released on Mar,18 2014 for general availability with the many featured enhancements. You can find all the enhancements in JDK 8 here.

Java on Linux

This article will help you to Install JAVA 8 (JDK 8u66) or update on your system. Read the instruction carefully for downloading java from Linux command line. To Install Java 8 in Ubuntu and LinuxMint read This Article.

Downloading Latest Java Archive

Download latest Java SE Development Kit 8 release from its official download page or use following commands to download from shell.

For 64Bit

# cd /opt/
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz"

# tar xzf jdk-8u121-linux-x64.tar.gz

For 32Bit

# cd /opt/
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-i586.tar.gz"

# tar xzf jdk-8u121-linux-i586.tar.gz

Note: If Above wget command does not work for you watch this example video to download java source archive using terminal.

Install Java with Alternatives

After extracting archive file use alternatives command to install it. alternatives command is available in chkconfig package.

# cd /opt/jdk1.8.0_121/
# alternatives --install /usr/bin/java java /opt/jdk1.8.0_121/bin/java 2
# alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
*  1           /opt/jdk1.7.0_71/bin/java
 + 2           /opt/jdk1.8.0_45/bin/java
   3           /opt/jdk1.8.0_91/bin/java
   4           /opt/jdk1.8.0_121/bin/java

Enter to keep the current selection[+], or type selection number: 4

At this point JAVA 8 has been successfully installed on your system. We also recommend to setup javac and jar commands path using alternatives

# alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_121/bin/jar 2
# alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_121/bin/javac 2
# alternatives --set jar /opt/jdk1.8.0_121/bin/jar
# alternatives --set javac /opt/jdk1.8.0_121/bin/javac

Check Installed Java Version

Check the installed Java version on your system using following command.

root@tecadmin ~# java -version

java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode, sharing)

Configuring Environment Variables

Most of Java based application’s uses environment variables to work. Set the Java environment variables using following commands

  • Setup JAVA_HOME Variable
  • # export JAVA_HOME=/opt/jdk1.8.0_121
  • Setup JRE_HOME Variable
  • # export JRE_HOME=/opt/jdk1.8.0_121/jre
  • Setup PATH Variable
  • # export PATH=$PATH:/opt/jdk1.8.0_121/bin:/opt/jdk1.8.0_121/jre/bin

Also put all above environment variables in /etc/environment file for auto loading on system boot.

출처 : http://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/#


Comment +0