1. Preparation and Installation
1) Download rpm installation (or the bundle rpm)
rpm installation package includes two (the bundle will be more), a is client, the other server, for example: MySQL-client-5.5.44-1. linux2.6.i386.rpm; MySQL-server-5.5.44-1.linux2.6.i386.rpm. .
2) Upload rpm (the bundle) installation packages
downloaded two rpm installation package uploaded to / usr / local / directory.
3) rpm package previously installed detection and removal
# rpm -qa|grep mysql
# rpm -e –-nodeps qt-mysql-4.6.2-26.el6_4.x86_64
# rpm -e –-nodeps mysql-server-5.1.71-1.el6.x86_64
# rpm -e –-nodeps mysql-libs-5.1.71-1.el6.x86_64
# rpm -e –-nodeps mysql-devel-5.1.71-1.el6.x86_64
# rpm -e –-nodeps mysql-5.1.71-1.el6.x86_64
4) Installation rpm package
# rpm -ivh the MySQL-Server-5.5.44-1.linux2.6.i386.rpm
# rpm -ivh the MySQL-Client-5.5.44-1.linux2.6.i386.rpm
--Note:
If the bundle is installed as rpm, then, as the need to decompress and install rpm package.
1) extract the tar package
# tar -xvf mysql-8.0.12-1.el6.x86_64.rpm-bundle.tar
2) sequential decompression rpm packages installed
# rpm -ivh mysql-community-common-8.0.12-1.el6.x86_64.rpm
# rpm -ivh mysql-community-libs-8.0.12-1.el6.x86_64.rpm
# rpm -ivh mysql-community-libs-compat-8.0.12-1.el6.x86_64.rpm
# rpm -ivh mysql-community-client-8.0.12-1.el6.x86_64.rpm
# rpm -ivh mysql-community-server-8.0.12-1.el6.x86_64.rpm
4) modify the configuration file, and copy
# cp /usr/share/mysql/my-medium.cnf /etc/my.cnf
Then, the configuration file /etc/my.cnf following variables were added.
[Client]
default-Character-the SET utf8 =
[mysqld]
default-Storage-Engine = INNODB
Character-the SET-Server = utf8
collation-Server = utf8_generic_ci
5) Start MySQL
# MySQL Service Start
2. Management and Configuration
1) Change My Password
# / usr / bin / mysqladmin -u root password 'new-passwd'
--Note:
1) It should be noted that, before mysql5.7.4, after installation default root no default password, and password can be obtained by mysqld.log, depending on the specific mysqld.log position setting, for example: / var / log / mysqld. log, / usr / local / mysql / mysqld.log like. May be obtained by the following command:
cat mysqld.log|grep pass
2) start and stop MySQL
# /etc/init.d/mysql Start
# / usr / bin / mysqladmin -u root -p the shutdown
# sudo restart /etc/init.d/mysql
3) self-boot configuration
# chkconfig --list
chkconfig mysql --del #
# chkconfig --add mysql
# chkconfig mysql ON
4) through the start-stop mysql user mysql database, an error may occur rights issues relevant variables can be set depending on the circumstances, such as:
datadir, socket, log-error, pid-file and so on. In addition, may also appear on permissions / var / lock / subsys / mysql error path, the path can not modify your mysql variables can be modified, but can be modified by /etc/init.d/mysqld script lockfile and change.