The dependencies required to install the system
[Email protected] ~]# yum-y install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* L ibtool-ltdl-devel* CMake Bison
Create MySQL user and user groups
[[email protected] ~]# Groupadd MySQL
[[email protected] ~]# useradd-r-g MySQL MySQL
installation MySQL
[Email protected] ~]# tar zxvf mysql-5.5.25.tar.gz
[Email protected] ~]# CD mysql-5.5.25
[Email protected] mysql-5.5.25]# cmake-dcmake_install_prefix=/opt/mysql/-dmysql_datadir=/opt/mysql/data-dmysql_ unix_addr=/opt/mysql/data/mysqld.sock-dwith_innobase_storage_engine=1-denabled_local_infile=1-dmysql_tcp_port= 3306-dextra_charsets=all-ddefault_charset=utf8-ddefault_collation=utf8_general_ci-dmysql_unix_addr=/opt/mysql/ Data/mysql.sock-dmysql_user=mysql-dwith_debug=0
[[email protected] mysql-5.5.25]# make && make install
Give permission to the relevant
[Email protected] mysql-5.5.25]# chown-r mysql:mysql/opt/mysql
[Email protected] mysql-5.5.25]#/opt/mysql/scripts/mysql_install_db--user=mysql--basedir=/opt/mysql--datadir=/ Opt/mysql/data
MySQL configuration file
[Email protected] mysql-5.5.25]# CP/OPT/MYSQL/SUPPORT-FILES/MY-LARGE.CNF/ETC/MY.CNF
[Email protected] mysql-5.5.25]# Cp/opt/mysql/support-files/mysql.server/etc/init.d/mysql
[Email protected] mysql-5.5.25]# chmod +x/etc/init.d/mysql
Increase Auto Start
[[email protected] mysql-5.5.25]# chkconfig MySQL on
Start MySQL
[[email protected] mysql-5.5.25]#/etc/init.d/mysql start
Starting MySQL ... [OK]
View MySQL of the 3306 Port, see the following instructions to start successfully
[[email protected] mysql-5.5.25] #ps aux | grep 3306
MySQL 17237 3.6 8.4 615660 86264 PTS/2 Sl 22:10 0:01/opt/mysql/bin/mysqld--basedir=/opt/mysql--datadir=/opt /mysql/data--plugin-dir=/opt/mysql/lib/plugin--user=mysql--log-error=/opt/mysql/data/namenode.err--pid-file=/ Opt/mysql/data/namenode.pid--socket=/opt/mysql/data/mysql.sock--port=3306
Root 17798 0.0 0.0 61228 784 pts/2 s+ 22:10 0:00 grep 3306
Set MySQL Initial Password, 123456 is the password, you can set the password you need
[Email protected] mysql-5.5.25]#/opt/mysql/bin/mysqladmin-u root password ' 123456 '
[Email protected] mysql-5.5.25]#/opt/mysql/bin/mysql-uroot-p123456
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 2
Server Version:5.5.25-log Source Distribution
Copyright (c), +, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
Mysql>
The above statement is successful.
This article is from the "Fly Hung 膤" blog, please be sure to keep this source http://jxzhfei.blog.51cto.com/1382161/1441329
Install MySQL under Linux