Install MySQL under Linux

Source: Internet
Author: User

Several ways to install MySQL:

1, the operating system comes with the RPM package, 2, the official MySQL RPM package, 3, the general binary format; 4, source code compilation

The following is installed by the method of yard code compilation, is Http://pan.baidu.com/s/1pJOhujh

Decompression: TAR-ZXF mysql-5.5.36.tar.gz

Switch to extract directory: CD mysql-5.5.36

Install the build environment: Yum install readline-devel ssl-devel zlib-devel gcc gcc-c++ ncurses-devel cmake-y

Compile: CMake. -dcmake_install_prefix=/usr/local/mysql \

-dmysql_datadir=/mydata/data \
-dsysconfdir=/etc-dwith_innobase_storage_engine=1
-dwith_archive_storage_engine=1 \
-dwith_blackhole_storage_engine=1 \
-dwith_readline=1 \
-dwith_ssl=system \
-dwith_zlib=system \
-dwith_libwrap=0 \
-dmysql_unix_addr=/tmp/mysql.sock \
-ddefault_charset=utf8 \
-ddefault_collation=utf8_general_ci

Finally, male and make install.

Of course, the installation environment of the appeal is not a successful one at a time, I am in my own machine environment, but also after many tests to succeed. If you are on your machine, you may also have to fail several times. If you fail, you need to delete CMakeCache.txt before compiling. Here is the error I quoted:

CMake error:your CXX Compiler: "Cmake_cxx_compiler-notfound" was not found. Need to install gcc-c++

Curses Library not found. Please install the appropriate package. Need to install Ncurses-devel

After the installation is MySQL's initial chemical industry.

1. Modify users and Groups:

Add MySQL group: groupadd-r mysql; add MySQL User: Useradd-r-G mysql-s/sbin/nologin

Create/mydata/data directory: Mkdir-p/mydata/data

Modified: chown-r: Mysql/usr/local/mysql; Chown-r Mysql:mysql/mydata/data

2. Execute initialization script: scripts/mysql_install_db--user=mysql--datadir=/mydata/data

  

Install MySQL under Linux

Related Article

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.