How to install MySQL without compilation on centos
MySQL without compilation is very convenient and saves a lot of time. I am using MySQL-x86_64. The next step is the installation process in CentOS6.5.
# Install dependency packages
Yum install-y libaio-devel
# Create a user
Useradd-s/sbin/nologin mysql
# Creating a data directory
Mkdir-p/data/mysql
# Granting permissions
Chown-R mysql: mysql/data/mysql
# Decompress
Tar zxvf mysql-5.5.42-linux2.6-x86_64.tar.gz
# Move to a specified directory
Music mysql-5.5.42-linux2.6-x86_64/usr/local/mysql
# Because the system has a default my. cnf, let's change its name.
Mv/etc/my. cnf/etc/my. cnf. default
# Copy my. cnf to the specified directory.
Cp/usr/local/mysql/support-files/my-large.cnf/etc/my. cnf
# There are several cnf entries in the support-files directory, which can be selected based on the memory size
My-small.cnf (memory <= 64 M)
My-medium.cnf (memory 128 M)
My-large.cnf (memory 512 M)
My-huge.cnf (memory 1 GB-2 GB)
My-innodb-heavy-4G.cnf (memory 4 GB)
# Edit the copied my. cnf and insert the following content in the next line of [mysqld]
Vi/etc/my. cnf
[Mysqld]
Basedir =/usr/local/mysql
Datadir =/data/mysql
Character-set-server = utf8
# Add environment variables and insert the following content at the end
Vi/etc/profile
PATH =/usr/local/mysql/bin: $ PATH
Export PATH
# Make the modification take effect
Source/etc/profile
# Copy the startup script to the specified directory
Cp/usr/local/mysql/support-files/mysql. server/etc/init. d/mysqld
# After all preparations are completed, initialize the database.
/Usr/local/mysql/scripts/mysql_install_db -- basedir =/usr/local/mysql -- datadir =/data/mysql -- user = mysql
# Starting a database
Service mysqld start
# Start startup
Chkconfig mysqld on
# Initialize some mysql settings
Mysql_secure_installation
# Press ENTER
Enter current password for root (enter for none ):
# Y: Set the mysql root Password.
Set root password? [Y/n] y
# Yes
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
ThanksforusingMySQL!
OK.
CentOS7 compilation and installation MySQL 5.6.28 and compilation Parameters
Compile and install MySQL 5.6.16 in CentOS 6.5
Installing MySQL 5.6.10 package conflict in Linux
Install MySQL 5.7.9 through source code compilation
CentOS 7 source code compilation and installation of PHP5.6, Nginx1.7.9 and MySQL (establish LNMP environment)
MySQL 5.7.9 source code compilation and installation instructions
Compile and install MySQL 5.7.5 from the source code in CentOS 6.6
Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04
MySQL-5.5.38 universal binary Installation
Install MySQL 5.6 with the source code in CentOS 7