install MySQL under Linux
1 Check and uninstall the installed MySQL
command:rpm-qa|grep-i MySQL
command:rpm-e--nodeps ' Last command shows the native installed MySQL dependency '
If there are already installed, then each dependency that appears after the last command is uninstalled in turn.
command:rm-rf/var/lib/mysql*
command:rm-rf/usr/share/mysql*
2 uninstalling mariadb
1). Check and uninstall the installed mariadb
command:rpm-qa | grep mariadb
command:rpm-e--nodeps ' Last command shows native installed mariadb dependent '
Example: Rpm-e--nodeps mariadb-libs-5.5.50-2.el7.x86_64
2). Install the system disk in the MySQL Dependency Packages
Mount System Installation u disk to directory /mnt
go to the Yum directory
Execute command:rm-rf *.repo
then write the file Centos.repo
command:Vi/etc/yum.repos.d/centos.repo
Write the content:
[Centos]name=centosbaseurl=file://mnt gpgcheck=0
input Complete: Press ESC exit : Wq Save File
Yum installs mysql dependent net-tools and perl
command: yum install Net-tools
Yum Install Perl
3.1 unpacking mysql package
Copy the files to the/opt/soft directory.
Command: Cd/opt/soft
command : TAR-XVF Mysql-5.5.48-1.el7.x86_64.rpm-bundle.tar
3.2 installing mysql
Command:
RPM-IVH mysql-server-5.5.48-1.el7.x86_64.rpm--nodeps--force
RPM-IVH mysql-devel-5.5.48-1.el7.x86_64.rpm--nodeps--force
RPM-IVH mysql-client-5.5.48-1.el7.x86_64.rpm--nodeps--force
3.3 Initializing the database
command: /usr/bin/mysql_install_db
command:service MySQL Start
3.4 Setting the root user password
command:mysql-uroot-p
Direct return
command:set PASSWORD=PASSWPRD ("123456");
command:grant all on * * to [e-mail protected] '% ' identified by ' 123456 ' with GRANT option;
command:flush privileges;
Offline installation of MySQL under Linux