Offline installation of MySQL under Linux

Source: Internet
Author: User
Tags save file install perl

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.