Prerequisite installation: VMware virtual machine, CentOS image [Note: When using CentOS under Linux, MySQL does not need to be downloaded from the official website, you only need to configure it]
The formal operation begins:
//A brief discussion on installing MySQL on CentOS
//MySQL
//1. Check whether the CD/DVD is connected in the virtual machine settings
// 2. Mount the CD. Command: mount /dev/cdrom /media
//3. Mount successfully. Enter yum.repos.d command cd /etc/yum.repos.d/
[Note here Use yum to install and configure If you want to know more about yum, please ask Du Niang】
//cd /etc/yum.repos.d/ After entering this path, start configuring the local yum source
//Readers, please pay attention to the explanation here
// cd /etc/yum.repos.d/
//Press LL to view and you will see the following 4 files
// You will see several repo files
// CentOS-Base.repo is the configuration file of yum network source
// CentOS-Media.repo is the configuration file of yum local source
// 3. Modify CentOS-Media.repo
// Modify the second path in baseurl to /media (that is, the CD mount point)
// Set enabled=0 Change to 1
// 4. Disable the default yum network source
// Rename the yum network source configuration file to CentOS-Base.repo.bak, otherwise it will first search for a suitable one in the network source Package, read directly from local source after renaming.
The modification command is: vim CentOS-Media.repo CentOS-Media.repo.bak
Generally, files ending with the suffix bak are disabled or system-specific
This is a necessary operation in the early stage
In the later stage, you only need to execute a few yum commands and it will be OK
// 5. Execute the yum command to install the software package
// yum -y install mysql
// yum -y install mysql-server
// yum -y install mysql-devel
// yum -y install mysql-lib
When the word complete appears, it is complete!
[Note: It is necessary to initialize the password after installing MySQL, that is, to change the password]
/3. Enter the path of the MySQL directory cd /var/lib /mysql
//4. Change the MySQL password for the first time /usr/bin/mysqladmin -u root password('newpassword');
Okay, the brief discussion of MySQL ends here. Continue learning tomorrow react
Readers who are cold about react are welcome to join the group to communicate!
The above is a brief discussion of the installation and configuration of MySQL under Linux CentOS. For detailed information, please pay attention to the PHP Chinese website (m.sbmmt.com) for more related content!