Offline installation of mysql and centosrpm using rpm in centos 6.4
Use the rpm installation package to install mysql offline.
Preparations:
Download the mysql offline rpm installation package from the official website (this will not be demonstrated here. Use the ready-made demo)
Uninstall and clear the remaining mysql installation and uninstall
1. Check and uninstall MySQL installed on the local machine
rpm -qa|grep -i mysql
Among them, the noarch is the source address package, and the same is true if it is not installed.
2. As shown in, MySQL is installed in the system and uninstalled:
[root@hellxz ~]# yum remove mysql
Run the first step again to check whether the installed mysql exists. If yes, run the yum remove command and add the package name you just found to uninstall it.
3. Check whether the/var/lib/mysql folder exists. If yes, delete the database with mysql residue. If not deleted, the newly installed mysql will not create a new database.
If yes, delete
rm -rf /var/lib/mysql
Install mysql
1. Upload the downloaded RPM package to centos, install the package, and install the server first.
rpm -ivh mysql-community-server-5.6.26-2.el6.i686.rpm
The installation is normal. If the installation is normal, ignore the following questions:
1.1 problems may occur here,For example, in this case, I had a hard time working on it for a while. Finally, I added the uninstalled package name to yum install, the strange thing is that the installation is complete without much traffic... The original package says 215 M. Actually, I don't see 5 M... it's strange.
2. then install the client, but I reported that the dependency is missing. Let me install another one first .. On my installation method:
rpm -ivh mysql-community-common-5.6.26-2.el6.i686.rpmrpm -ivh mysql-community-libs-5.6.26-2.el6.i686.rpm rpm -ivh mysql-community-client-5.6.26-2.el6.i686.rpm
3. Start the MySQL service after installation:
# Don't ask why I add d. It may be a different version of service mysqld restart.
4. Change the default password:
#-U is followed by the user name, followed by the root is the password, modify/usr/bin/mysqladmin-u root password 'root' as appropriate'
5. Open the mysql command line:
# The user name is directly added without spaces behind-u, and the user name is prompted to enter the password mysql-uroot-p.
6. remote connection authorization (for local use only, you can leave it unspecified ):
# The authorization @ frontend is the user name, followed by the password grant all privileges on *. * TO 'root' @ '% 'identified BY 'root' with grant option;
7. Use navicat to connect to the mysql experiment in the virtual machine:
8. If Step 1 appears
Disable the firewall in centos and temporarily close the Code:
Disable firewall command: service iptables stop
Permanently disable the firewall: chkconfig iptables off
The tutorial is complete.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.