Compile and install mysql5.5 in nginx

Source: Internet
Author: User


-With-plugins = csv, myisam, myisammrg, heap, innobase
-DWITH_INNOBASE_STORAGE_ENGINE = 1 and-DWITHOUT_INNOBASE_STORAGE_ENGINE = 1

/Usr/local/bin/cmake-DCMAKE_INSTALL_PREFIX =/usr/mysql
-DMYSQL_DATADIR =/usr/mysql/data
-DWITH_MYISAM_STORAGE_ENGINE = 1
-DWITH_ARCHIVE_STORAGE_ENGINE = 1
-DWITHOUT_INNOBASE_STORAGE_ENGINE = 1
-DWITH_BLACKHOLE_STORAGE_ENGINE = 1
-DENABLED_LOCAL_INFILE = 1
-DMYSQL_UNIX_ADDR =/tmp/mysqld. sock
-DDEFAULT_CHARSET = utf8
-DDEFAULT_COLLATION = utf8_general_ci
-DEXTRA_CHARSETS = all
-DMYSQL_TCP_PORT = 3306

Mysql 5.5.19 cmake compilation and installation

1. Install the required system library files
Yum-y install gcc-c ++ gcc-g77 autoconf automake zlib * fiex * libxml *
Ncurses-devel libmcrypt * libtool-ltdl-devel *
2. Create the mysql installation directory
# Mkdir-p/usr/local/webserver/mysql/
3. Create a data storage directory
# Mkdir-p/data/mysql/

4. Create users and user groups and grant data storage directory permissions

# Groupadd mysql
# Useradd-g mysql
# Chown mysql. mysql-R/data/mysql/

5. Install cmake (after mysql5.5 is compiled using cmake)
 
# Wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
# Tar zxvf cmake-2.8.4.tar.gz
# Cd cmake-2.8.4
#. Configure
# Make & make install

6. Download and decompress mysql 5.5.11

Wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.19.tar.gz
[Root @ localhost down] # tar zxvf mysql-5.5.19 .tar.gz
[Root @ localhost down] # cd mysql-5.5.19

7. Compile mysql-5.5.19

Cmake. -DCMAKE_INSTALL_PREFIX =/usr/local/webserver/mysql/-DMYSQL_DATADIR =/data/mysql-DMYSQL_UNIX_ADDR =/tmp/mysqld. sock-keys = 1-DENABLED_LOCAL_INFILE = 1-keys = 3306-DEXTRA_CHARSETS = all-DDEFAULT_CHARSET = utf8-DDEFAULT_COLLATION = utf8-general_ci-DMYSQL_UNIX_ADDR =/tmp/mysql. sock-DMYSQL_USER = mysql-DWITH_DEBUG = 0
[Root @ host mysql-5.5.11] # make
[Root @ host mysql-5.5.11] # make install

8. Copy the configuration file.

[Root@mysql-5.5.11] # cp support-files/my-medium.cnf/etc/my. cnf
[Root@mysql-5.5.11] # cp support-files/mysql. server/etc/init. d/mysqld

[Root@mysql-5.5.11] # chmod 755/etc/init. d/mysqld
9. Initialize the database

Bash scripts/mysql_install_db -- user = mysql -- basedir =
/Usr/local/webserver/mysql -- datadir =/data/mysql/

10. Start the mysql service.

[Root @ localhost mysql-5.5.11] #/etc/init. d/mysqld start
11. Run the ps-ef | grep mysql command to check whether the instance is started.
12,/usr/local/webserver/mysql/bin/mysql-u root-p
The initial password for logging on to the MySQL server through the command line is blank.
13. Change the root password
Mysql>; use mysql;
Mysql>; update user set password = PASSWORD ("123456") where user = 'root ';
Mysql>; flush privileges;

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.