Offline compilation and installation of MySQL5.6.22 on CentOS6.5.
Offline compilation and installation of MySQL 5.6.22 on CentOS 6.5.
Offline compilation and installation of MySQL 5.6.22 on CentOS 6.5.
1. Download the source code package
2. Preparations
Uninstall the MYSQL
Install cmake and compile MYSQL tools
Yum install cmake
3. decompress the source code package
Tar-zxv-f mysql-5.6.16.tar.gz
Cd mysql-5.6.16
Iv. CMake Compilation
Cmake \
-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \
-DMYSQL_UNIX_ADDR =/usr/local/mysql. sock \
-DDEFAULT_CHARSET = utf8 \
-DDEFAULT_COLLATION = utf8_general_ci \
-DWITH_INNOBASE_STORAGE_ENGINE = 1 \
-DWITH_ARCHIVE_STORAGE_ENGINE = 1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE = 1 \
-DMYSQL_DATADIR =/jbdata/mysqldb \
-DMYSQL_TCP_PORT = 3306 \
-DENABLE_DOWNLOADS = 1
Note: delete the cmakecache.txt file after you refresh the configuration.
Execute make
Make
Install
Make install
V. initialize the mysql database
Cd/usr/local/mysql
Scripts/mysql_install_db -- user = mysql -- datadir =/data/mysqldb
6. Copy the Startup File
To start mysqld at boot time you have to copy
Support-files/mysql. server to the right place for your system
Cp/usr/local/mysql/support-files/my-default.cnf/etc/my. cnf
7. Copy the Service Startup Script and add the PATH
Cp support-files/mysql. server/etc/init. d/mysqld
Modify the PATH environment variable so that the system can directly use mysql-related commands.
# Vim/etc/profile. d/mysql. sh
Export PATH = $ PATH:/usr/local/mysql/bin
Bytes -------------------------------------------------------------------------------------
Vim/etc/profile
PATH =/usr/local/mysql/bin:/usr/local/mysql/lib: $ PATH
Export PATH
Source/etc/profile
8. Start mysql and add it to startup
Service mysqld start
Chkconfig -- level 35 mysqld on
9. Check whether mysql is started.
Netstat-tulnp | grep 3306
Mysql-u root-p
10. Set the mysql password
Please remember to set a password for the MySQL root USER!
To do so, start the server, then issue the following commands:
./Bin/mysqladmin-u root password 'new-password'
./Bin/mysqladmin-u root-h localhost. localdomain password 'new-password'
Alternatively you can run:
./Bin/mysql_secure_installation
If you are interested, you can also read this article:
Install MySQL 5.6.23 in Linux
The following is the MySQL-related content carefully selected by the editor to see if it is helpful:
Install MySQL 5.6 with the source code in CentOS 7
How to install and configure MySQL5.7.3.0
Install MySQL in Ubuntu 14.04
MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF
Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL
Build a MySQL Master/Slave server in Ubuntu 14.04
Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS
Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04
MySQL-5.5.38 universal binary Installation
-------------------------------------- Split line --------------------------------------
This article permanently updates the link address: