Use cmake to compile and install MySQL 5.5

Source: Internet
Author: User
Tags localhost mysql

Use cmake to compile and install MySQL 5.5

First, upload the source code package cmake-2.8.8.tar.gz?mysql-5.5.32.tar.gz to the server.

Decompress and install cmake

[Root @ localhost ~] # Tar-zxvf cmake-2.8.8.tar.gz
[Root @ localhost ~] # Cd cmake-2.8.8
[Root @ localhost cmake-2.8.8] #./configure
......
-- Processing ing done
-- Generating done
-- Build files have been written to:/root/cmake-2.8.8
---------------------------------------------
CMake has bootstrapped. Now run gmake.

Make sure that no cmake error occurs

[Root @ localhost cmake-2.8.8] # echo $?
0

Run the following gmake command:
[Root @ localhost cmake-2.8.8] # gmake
[Root @ localhost cmake-2.8.8] # gmake install

3. Install the MySQL dependency table ncurses-devel

[Root @ localhost cmake-2.8.8] # yum install ncurses-devel-y

4. Create a mysql user

[Root @ localhost cmake-2.8.8] # groupadd mysql

[Root @ localhost cmake-2.8.8] # useradd mysql-s/sbin/nologin-M-g mysql

5. decompress and compile MySQL

[Root @ localhost ~] # Cd ..
[Root @ localhost ~] # Tar-zxvf mysql-5.5.32.tar.gz
[Root @ localhost ~] # Cd mysql-5.5.32
[Root @ localhost mysql-5.5.32] # cmake-DCMAKE_INSTALL_PREFIX =/application/mysql-5.5.32 \
-DMYSQL_DATADIR =/application/mysql-5.5.32/data \
-DMYSQL_UNIX_ADDR =/application/mysql-5.5.32/tmp/mysql. sock \
-DDEFAULT_CHARSET = utf8 \
-DDEFAULT_COLLATION = utf8_general_ci \
-DWITH_EXTRA_CHARSETS = all \
-DWITH_INNOBASE_STORAGE_ENGINE = 1 \
-DWITH_ARCHIVE_STORAGE_ENGINE = 1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE = 1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE = 1 \
-DWITH_SSL = yes \
-DENABLED_LOCAL_INFILE = 1

[Root @ localhost mysql-5.5.32] # make & make install

Create a link for the installation directory

[Root @ localhost mysql-5.5.32] # ln-s/application/mysql-5.5.32 // application/mysql

Copy the configuration file in the source code directory to the/etc directory.

[Root @ localhost mysql-5.5.32] # cp support-files/my-small.cnf/etc/my. cnf

6. Configure Environment Variables

1 [root @ localhost mysql-5.5.32] # echo 'export PATH =/application/mysql/bin: $ path'>/etc/profile

7. Authorize mysql users to access the installation directory

[Root @ localhost mysql] # chown mysql. mysql-R/application/mysql

8. initialize the mysql database

[Root @ localhost scripts] #./mysql_install_db -- basedir =/application/mysql -- datadir =/application/mysql/data -- user = mysql
Installing MySQL system tables...
OK
Filling help tables...
OK
 
To start mysqld at boot time you have to copy
Support-files/mysql. server to the right place for your system
 
Please remember to set a password for the MySQL root USER!
To do so, start the server, then issue the following commands:
 
/Application/mysql/bin/mysqladmin-u root password 'new-password'
/Application/mysql/bin/mysqladmin-u root-h localhost. localdomain password 'new-password'
 
Alternatively you can run:
/Application/mysql/bin/mysql_secure_installation
 
Which will also give you the option of removing the test
Databases and anonymous user created by default. This is
Stronugly recommended for production servers.
 
See the manual for more instructions.
 
You can start the MySQL daemon:
Cd/application/mysql;/application/mysql/bin/mysqld_safe &
 
You can test the MySQL daemon with mysql-test-run.pl
Cd/application/mysql-test; perl mysql-test-run.pl
 
Please report any problems with the/application/mysql/scripts/mysqlbug script!

9. Create a mysql Startup Script

[Root @ localhost mysql-5.5.32] # cp support-files/mysql. server/etc/init. d/mysqld

10 start mysql

[Root @ localhost mysql-5.5.32] #/etc/init. d/mysqld start
Starting MySQL ..

Compile and install MySQL 5.5 Based on Cmake

This article permanently updates the link address:

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.