Centos6.4 installing Erlang and configuring the MySQL database

Source: Internet
Author: User

When installing, be sure to use the Centos6.4 disc as a Yum source, otherwise the version of the problematic OpenSSL may be used

1, first to install GCC gcc-c++ OpenSSL and other dependent modules:

Yum-y install make GCC gcc-c++ kernel-devel M4 ncurses-devel Openssl-devel

2. Re-install the ncurses module

Yum-y Install Ncurses-devel

Yum Install Ncurses-devel

3, download Erang source code file otp_src_r15b03-1.tar.gz file, and to pay permission and decompression files:

chmod +x otp_src_r16b03-1.tar.gz

TAR-XZVF otp_src_r16b03-1.tar.gz

MV Otp_src_r16b03-1/sysadmin/erlang_r16b #重命名解压厚的文件

4. The following are the plays that install Erlang, in turn, do the following:

cd/sysadmin/erlang_r15b/

./configure--prefix=/usr/local/erlang--with-ssl--enable-threads--enable-smp-support--enable-kernel-poll-- Enable-hipe--without-javac//No Java compilation, so remove Java to avoid errors

Make && make install//post-build installation

5. Configure the Erlang environment:

Vi/etc/profile

Export path= $PATH:/usr/local/erlang/bin

Well, now that Erlang is configured, let's take a look at the results:

# Whereis Erlang

Erlang:/usr/local/erlang

To this Erlang installation succeeds.

--------------------------------------------------------------------------------------------------------------- -----------------

Next, install the MySQL database driver

Install the MySQL driver, which can be downloaded from GitHub. Https://github.com/dizzyd/erlang-mysql-driver.git after downloading, compile,

You will get several files related to the MySQL database driver program, and then organize the file into Erlang's library directory, as follows:

1. Go to the Erang-mysql-driver directory and execute the make command.

2. If the resulting *.beam file is in the SRC folder, the files are moved to the Ebin directory.

3. Copy the EBIN,INCLUDE,SRC 3 folders to the/usr/local/erlang/lib/erlang/lib/mysql directory

The MySQL database driver has been successfully installed.

You can verify that the installation was successful by using the following procedure:

1Mysql:start_link (P1, "localhost", 3306, root, root, test, Fun(_, _, _, _), OKEnd), 2Mysql:connect (P1, "localhost", undefined, root, root, test,true).3 4Mysql:fetch (P1, << "CREATE TABLE memory_test (ID int not NULL auto_increment,5A1int  not NULL,  6A2int  not NULL,  7Primary key (ID)) engine = Memory ">>).8 9  TenMysql:start_link (conn, "localhost", 3306, "root", "root", "test", Undefined,utf8). One{data, Result} = Mysql:fetch (conn, << "SELECT * from 52qdhzl_admin" >>). ARows = mysql:get_result_rows (Result).


--------------------------------------------------------------------------------------------------------------- ------

Install MySQL

Yum install-y mysql-server MySQL Mysql-deve
Service mysqld Start
Chkconfig--list | grep mysqld
Chkconfig mysqld on
Mysqladmin-u root password ' root '
CENTOS64 cannot log on after installing MySQL
Mysql-uroot-p
Enter the password for the setting, this is root

After successful login, in order to enable MySQL to telnet, you need to do the following settings:

' Root '@'%'root'0 rows affected ( 0.00 sec) MySQL>0 rows affected (0.00 sec)

In this case, the Erlang,mysql has been successfully installed and the MySQL database driver has been configured.

Centos6.4 installing Erlang and configuring the MySQL database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.