MySQL database installation manual in Linux system
First, installation Overview:
Installing the MySQL database in the Linux operating system is a technology that we have to master, and it also determines the salary for your future job, so you know it's awesome! Learn to install is only the first step, you have to learn the basic operation of the database, as well as build a database of master-slave configuration and so on. I'll talk about that in the back of the blog post. Below I will simply write some of the steps to install MySQL database, for reference only, if there is anything wrong, please forgive me!
Second, installation steps:
(i) basic preparatory work
1. Open the virtual machine and download the latest version of the MySQL database in the virtual machine. Download on MySQL official website: "https://dev.mysql.com/downloads/". Select the appropriate version information.
650) this.width=650; "src=" https://s1.51cto.com/wyfs02/M00/06/5F/wKiom1m3Sc6iOoRFAAAzdWNh4cw416.jpg "title=" 1.jpg "alt=" Wkiom1m3sc6ioorfaaazdwnh4cw416.jpg "/>
This article is selected as a package that ends with ". Gz"
650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M02/A5/0F/wKioL1m3SfiQhIgxAAAay5dknIY135.jpg "title=" 2.jpg "alt=" Wkiol1m3sfiqhigxaaaay5dkniy135.jpg "/>
2, open the terminal on the desktop. and switch to the root user for action.
650) this.width=650; "src=" https://s3.51cto.com/wyfs02/M02/06/5F/wKiom1m3SpWxLbxwAAA1vkn36IU745.jpg "title=" 3.jpg "alt=" Wkiom1m3spwxlbxwaaa1vkn36iu745.jpg "/>
3. Check if MySQL database and old database are installed in the system
650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M02/A5/0F/wKioL1m3SqzzB7qcAAAXVqTHoVc455.jpg "title=" 4.jpg "alt=" Wkiol1m3sqzzb7qcaaaxvqthovc455.jpg "/>
If please uninstall, do not continue
"Uninstall"
1. Use normal delete and brute force delete
rpm-e MySQL and the rpm-e--nodeps MySQL
4. Check if your Linux system has CMake installed
650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M01/A5/10/wKioL1m3SxfQolgAAAAPOOBcC_4876.jpg "title=" 5.jpg "alt=" Wkiol1m3sxfqolgaaaapoobcc_4876.jpg "/>
If you have installed CMake command, it will show CMake the absolute path of the command and CMake absolute path to the command Help manual. No installation Please use the command to install
650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M00/06/5F/wKiom1m3S3aimY7CAAAN7IyMciA444.jpg "title=" 6.jpg "alt=" Wkiom1m3s3aimy7caaan7iymcia444.jpg "/>
(ii) formal installation
1. Copy the downloaded MySQL database to the specified folder and store it in the "TMP" folder as well.
2. Enter the TMP folder on the terminal .
the cd/tmp press ENTER to switch to tmp folder.
3, in the current folder decompression MySQL compressed package.
650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M00/A5/10/wKioL1m3TS7DJ8THAAAm8xcn60w236.jpg "title=" 7.jpg "alt=" Wkiol1m3ts7dj8thaaam8xcn60w236.jpg "/>
4. by command:yum list | grep mysql to view The downloadable version of the database available on yum
650) this.width=650; "src=" https://s1.51cto.com/wyfs02/M00/06/5F/wKiom1m3TZKDF1I8AACVgYzX-ME398.jpg "title=" 8.jpg "alt=" Wkiom1m3tzkdf1i8aacvgyzx-me398.jpg "/>
5. Install mysql-service.i686 Server
Command:yum install mysql-server.i686
Note Enter the version information for the MySQL database Oh!
6. Restart the database server
Command:service mysqld start
7. set user name and password
Command:/usr/bin/mysqladmin-u root password ' dzx123 '
8. securely Configure MySQL database to prevent hacker attacks. Execute Command
Command: /usr/bin/mysql_secure_installation
8.1.Show1:Enter current password Forroot (enter for none):here, enter the currentRootPassword "dzx123"
8.2. Display 2:change theroot password?[ Y/N] n. Whether to set the password, we have no need to.
8.3, display 3:Remove Anonymous users?[ y/n] y. Whether to delete the exception user, generally only one root user can be retained.
8.4.Show4:Disallow root loginremotely? [y/n] Y. of yourRootthe user will be directly connected to the localMySQLdatabase, you need to enter a password. Whether to open the remote to connect the database, obey the master-slave database.
8.5 , Span style= "font-size:14px;font-family: ' The song body '; color: #333333; background: #FAFAFC;" > display 5 remove Test Database andaccess to it? [y/n] Y Test database. It is best to remove the
8.6, display 6:Reload privilege tables now? [y/n] Y. Whether to reload permissions. is a
9. Enter the database at this time.
command: mysql-uroot–p.
Command: Exit exits the database.
10. Configure the MySQL server to start automatically.
(1) We can use the command:chkconfig--list | grep mysqld to see if the boot starts automatically. If all the 2~5 are on
(2) instructions are automatically started on boot, otherwise if not. We can set the boot to start automatically by command chkconfigmysqld on.
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/A5/10/wKioL1m3T-PygpPFAABB80xjvsA696.jpg "title=" 11. JPG "alt=" wkiol1m3t-pygppfaabb80xjvsa696.jpg "/>
11. Start the database service
Command:service mysqld start
12. Close the database service
command: service MySQL Stop
Third, concluding remarks:
Here, our MySQL database is installed, in the process of installation, we must be careful, especially when configuring the relevant configuration. This will allow you to install the database on your Linux system and you will be able to operate it directly.
This article from "Lonely One Night" blog, declined reprint!
Installation of MySQL database operating manual in Linux system