Use the rpm installation package to install mysql offline, just for your reference Preparation: Download the MySQL offline rpm installation package from the official website (I won’t demonstrate it here, I’ll just use the existing one for demonstration) Uninstall and clean up the remnants of previous MySQL installation and uninstallation 1. Detect and uninstall MySQL installed on this machine rpm -qa|grep -i mysql The noarch one is the source address package, it is the same even if it is not installed 2. As shown in the figure above, MySQL has been installed in the system. Uninstall it: [root@hellxz ~]# yum remove mysql Then execute the first step again to check whether MySQL is installed. If so, you can directly uninstall it by adding the package name you just found with yum remove. 3. Check whether the /var/lib/mysql folder exists. If so, please delete it. It contains the remaining MySQL database. If you do not delete it, the newly installed MySQL will not create a new database. If so, delete rm -rf /var/lib/mysql Install mysql 1. Upload the previously downloaded RPM package to centos and install it, first installing the server. rpm -ivh mysql-community-server-5.6.26-2.el6.i686.rpm The above picture shows a normal installation. Please ignore the following issues if the installation is normal. 1.1 There may be problems here, as shown in the figure below. When this happened, I was very entangled for a while. In the end, I added the package name that was not installed to yum install. Strangely, it was installed without much traffic. . . The original package says 215M, but mine shows less than 5M...very weird 2. Then the client should be installed, but I reported missing dependencies, so I have to install something else first. . Here is my installation method: rpm -ivh mysql-community-common-5.6.26-2.el6.i686.rpm rpm -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 the installation is complete: #Don't ask me why I added d, it may be a different version service mysqld restart 4. Change the default password: #-u is followed by the username, and root is followed by the password. Modify as appropriate /usr/bin/mysqladmin -u root password 'root' 5. Open the mysql command line: #There is no space after -u, just add the username, and after entering this, you will be prompted to enter the password mysql -uroot -p 6. Remote connection authorization (not required for local use): #Authorization: the @ before is the user name, the by after is 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 7 appears Please turn off the firewall in centos and temporarily turn off the code: Disable the firewall command: service iptables stop Permanently turn off the firewall: chkconfig iptables off End of tutorial. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Detailed explanation of the basic use of centos7 firewall in linux
>>: CocosCreator classic entry project flappybird
Table of contents 1. Insert statement 1.1 Insert ...
Table of contents Written in front Precautions De...
1. Review The Buffer Pool will be initialized aft...
Table of contents React Fiber Creation 1. Before ...
Preface Recently, I took over a client's nati...
Table of contents Step 1: Log in as root user. St...
This article example shares the specific code of ...
Prerequisite: Save the .frm and .ibd files that n...
I was bored and sorted out some simple exercises ...
Preface The concept of dark mode originated from ...
Table of contents Initialize the project Writing ...
Copy code The code is as follows: <form action...
Table of contents 1. Use 2. Solve the problem of ...
Preface Not long ago, I saw an interesting proble...
Table of contents Install Docker-ce for the devel...