Linux compilation install MySQL

Source: Internet
Author: User

Recently wanted to engage in Hadoop, then put a MySQL, test the sqoop.

MySQL this thing, since it is open source, then the source of the installation bar.

Here is a description of my test environment:

vmware10+ubuntu14.04 Kylin

The following starts with a step-by-step write (not specifically noted, is performed by the root user):

1 Downloads mariadb Source: https://downloads.mariadb.org/mariadb/10.0.14/, downloaded file: mariadb-10.0.14.tar.gz

2 installation Cmake:apt-get Install Cmake,ubuntu may not be the latest version of CMake on the source, but can be used. If you want to install the source code CMake can refer to search engines.

3 There are some dependencies on the installation, but I still do not know what the specific needs, but libaio-dev this is to be installed, the other can be searched.

4 Decompression Source Package, I unzipped the path is:/root/mariadb-10.0.14/, enter the path, enter the following command:

CMake. -dcmake_install_prefix=/usr/mysql-dmysql_datadir=/home/mysql/data-ddefault_charset=utf8-ddefault_collation= utf8_general_ci-dextra_charsets=all-denabled_local_infile=1

This needs to be modified according to the path you have planned.

5 This need not be too long, but if you are prompted to look at the error log, it is generally a lack of dependency packages, search related errors to install the relevant dependencies can be.

6 If an error occurs, the Cmakecache file needs to be deleted when compiling again.

7 do not appear after the error prompt input: Make, after the end of the input make install. Make takes a long time, the period will prompt a lot of warning, directly ignore can.

8 after the above steps complete the installation, you can initialize the database below. Modify the/usr/mysql owner to MySQL. Enter/usr/mysql/support_files, execute

CP MY-LARGE.CNF/ETC/MY.CNF

CP Mysql.server/etc/init.d/mysql

To modify/ETC/MY.CNF, add the following statement:

Tmpdir =/home/mysql/tmp/
Basedir=/usr/mysql
Datadir=/home/mysql/data

Note To create the relevant directory and modify the owner to MySQL.

Modify the/etc/init.d/mysql to modify the values of Basedir and DataDir into a planned directory.

9 Enter/usr/mysql/script, execute the following statement:

./mysql_install_db--user=mysql--basedir=/usr/mysql--datadir=/home/mysql/data

Many prompts after execution, modify/etc/profile, add PATH variable: Export path= $PATH:/usr/mysql/bin

Executive Source/etc/profile

10 Starting MySQL services: Service MySQL Start

11 Execution: mysqladmin-u root password ' root '

12 that's it. Mysql,su to MySQL user, execute: mysql-uroot-proot can go to MySQL command line.

The same procedure applies to MySQL, because the mariadb itself and MySQL have no upside-down differences.

Linux compiled to install MySQL

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.