Centos 6.4 64-bit compilation and installation of mysql5.6 steps

Source: Internet
Author: User
Tags chmod mkdir centos


Direct-to-topic: dependency installation

Installation environment: centos 6.4 x86_64

Install the c ++ compiling environment:


Yum install gcc-c ++ ncurses-devel
Bision:


Cd/usr/local/src
Wget http://ftp.gnu.org/gnu/bison/bison-2.7.1.tar.gz
Tar-zxf bison-2.7.1.tar.gz
Cd bison-2.7.1
./Configure
Make & sudo make install
Cd ..
Cmake:


Wget http://www.cmake.org/files/v2.8/cmake-2.8.11.tar.gz
Tar-zxf cmake-2.8.11.tar.gz
Cd cmake-2.8.11
./Bootstrap
Make
Sudo make install
Or

./Configure
Gmake
Sudo make install
Cd ..


Curl-O http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.12.tar.gz
Tar-zxf mysql-5.6.12
Cd mysql-5.6.12
 
# Add the execution user name and group

Groupadd mysql
Useradd-g mysql
 
# Start compilation and installation

Cmake-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \
-DMYSQL_UNIX_ADDR =/tmp/mysql. sock \
-DDEFAULT_CHARSET = utf8 \
-DDEFAULT_COLLATION = utf8_general_ci \
-DWITH_EXTRA_CHARSETS = all \
-DWITH_MYISAM_STORAGE_ENGINE = 1 \
-DWITH_INNOBASE_STORAGE_ENGINE = 1 \
-DWITH_MEMORY_STORAGE_ENGINE = 1 \
-DWITH_READLINE = 1 \
-DENABLED_LOCAL_INFILE = 1 \
-DMYSQL_DATADIR =/var/mysql/data \
-DMYSQL_USER = mysql
Make-j8
Make install
 
# Changing owner and control permissions

Chmod + w/usr/local/mysql
Chown-R mysql: mysql/usr/local/mysql
Mkdir-p/var/mysql/
Mkdir-p/var/mysql/data/
Mkdir-p/var/mysql/log/
Chown-R mysql: mysql/var/mysql/
 
# Configuration files and installation services

Cd support-files/
Cp my-default.cnf/var/mysql/my. cnf
Cp mysql. server/etc/rc. d/init. d/mysqld
Chmod + x/etc/init. d/mysqld
Chkconfig -- level 345 mysqld on
 
# Initializing a database

/Usr/local/mysql/scripts/mysql_install_db \
-- Defaults-file =/etc/my. cnf \
-- Basedir =/usr/local/mysql \
-- Datadir =/var/mysql/data \
-- User = mysql
 
# Creating soft links
Ln-s/usr/local/mysql/bin/mysqladmin/usr/bin/
Ln-s/usr/local/mysql/bin/mysql/usr/bin/
 
# Start the MySQL service
Service mysqld start
# Modifying the root account password
Mysqladmin-u root password 123456
 
# Log on to MySQL
Mysql-uroot-p
 
# Create a MySQL account
Create user 'Ryan' @ 'localhost' identified by 'some _ pass'; # some_pass is the ryan account password
 
# Authorize user ryan. Of course you 'd better not do this.
Grant all privileges on *. * TO 'ry' @ '%' identified by 'some _ Pass' with grant option;
 
# Refresh permissions
Flush privileges;
 
# Modifying the default engine
Set global storage_engine = MYISAM
Set storage_engine = MYISAM
It is easy to write and has little text description. It can be used as a reference for yourself. Close!

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.