1.RPM Package Installation Method
RPM Package installation is very simple, here is the EL6 platform under the mysql-5.6.34 version for example, first, the above Sohu image address to download to the following four MySQL-related software installation package.
A. Download the installation package
mysql-client-5.6.34-1.el6.x86_64.rpm
mysql-devel-5.6.34-1.el6.x86_64.rpm
mysql-server-5.6.34-1.el6.x86_64.rpm
mysql-shared-5.6.34-1.el6.x86_64.rpm
In general, the two packages of mysql-server-5.6.34-1.el6.x86_64.rpm and mysql-client-5.6.34-1.el6.x86_64.rpm are required to be installed, and as for the other two packages, The installation is actually required, but it is generally recommended to install it together.
You can upload these four RPM packages to the server's directory, and then perform the following RPM commands to install them:
[email protected]]# rpm-qa|grep mysql or MySQL--version #<== find the installed MySQL package.
Mysql-libs-5.1.73-7.el6.x86_64
RPM-E mysql-libs-5.1.73-7.el6.x86_64 #<== Uninstall system already installed MySQL dependency pack.
To execute the installation command:
RPM-IVH mysql-client-5.6.34-1.el6.x86_64.rpm #<==ivh is installed in verbose mode
RPM-IVH mysql-devel-5.6.34-1.el6.x86_64.rpm
RPM-IVH mysql-shared-5.6.34-1.el6.x86_64.rpm
RPM-IVH mysql-server-5.6.34-1.el6.x86_64.rpm
Execute the above command to complete the installation of the MySQL software.
In the case of RPM package installation, the existing RPM packages must be provided by the official or the third party, otherwise it cannot be installed in this way. In addition, the RPM package can often be installed in a newer version than the one installed directly with Yum, but the RPM package installation also has its own problems, such as the inability to meet a custom installation, such as the inability to make changes to compilation parameters, paths, and so on.
2. Install with Yum
y When you install the MySQL database in UM mode, you only need to execute a command yum install mysql-server-y, the Yum installation principle is to automatically download the corresponding name MySQL database rpm package from the Yum source address after the Yum install command is executed. It is then installed on the system and automatically resolves dependencies between the various packages. This is a great way to install software, not just for MySQL, but for installing other software as well.
The biggest advantage of Yum installation is super simple, but it also has its own problems, such as it inherits the RPM package can not be customized installation problems, another disadvantage is that the default Yum installation, the general Yum source with the software version is relatively low.
But do not know the initial password, the database root password can not be modified, because the lack of mysql.user table, after the discovery is their own configuration has errors, according to the online tutorial, no one pointed out, some details of the dead.
Reason:
A source of the newly installed MySQL, because there is no replication my-default.cnf to/etc/my.cnf location, when the start of MySQL encountered the failure to open the Mysql.user table error. The specific error is: [ERROR] Fatal Error:can ' t open and Lock Privilege tables:table ' mysql.user ' doesn ' t exist. The following is a description of the error and its workaround.
1. Description of the phenomenon 123456
[[Email protected] scripts]# service mysqld start
Starting MySQL. The server quit without updating PID file (/var/lib/mysql/hkbo.pid). [FAILED]
#查看错误日志
[Email protected] scripts]# Tail/var/log/mysqld.log
innodb:apply Batch Completed
2014-12-08 11:01:37 15721 [Note] innodb:128 rollback segment (s) is active.
2014-12-08 11:01:37 15721 [Note] innodb:waiting for purge to start
2014-12-08 11:01:37 15721 [Note] innodb:5.6.12 started; Log sequence Number 1600607
2014-12-08 11:01:37 15721 [Note] Server hostname (bind-address): ' * '; port:3306
2014-12-08 11:01:37 15721 [Note] IPv6 is available.
2014-12-08 11:01:37 15721 [note]-':: ' resolves to ':: ';
2014-12-08 11:01:37 15721 [Note] Server socket created on IP: ':: '.
2014-12-08 11:01:37 15721 [ERROR] Fatal Error:can ' t open and Lock Privilege tables:table ' mysql.user ' doesn ' t exist
141208 11:01:37 mysqld_safe mysqld from PID File/var/lib/mysql/hkbo.pid ended
# Author:leshami
# Blog:http://blog.csdn.net/leshami
2. Solutions
#查看当前的my. CNF configuration file
[Email protected] scripts]# more/etc/my.cnf |grep-v ^#
[Mysqld]
Datadir=/var/lib/mysql
Socket=/var/lib/mysql/mysql.sock
User=mysql
Old_passwords=1
[Mysqld_safe]
Log-error=/var/log/mysqld.log
Pid-file=/var/run/mysqld/mysqld.pid
The datadir specified when #由于编译安装时指定的路径为/opt/data and mysql_install_db are also/opt/data, and MY.CNF is the default path
#因此修改datadir至正确路径后, Problem solving
[Email protected] scripts]# VI/ETC/MY.CNF
[Email protected] support-files]# more/etc/my.cnf |grep datadir
Datadir=/opt/data
[[Email protected] support-files]# service mysqld start
Starting MySQL. [OK]
MySQL Multiple installation options