Unloading system comes with MySQL
1. Check the system is currently installed MySQL
rpm -qa|grep -i mysql
2. Uninstall the current version of MySQL
yum remove mysql mysql-server mysql-libs mysql-server
The Select uninstall process, direct "y" like
Check again no information indicating uninstalled
3. Find the remaining files, deleted
find / -name mysql
4. Create mysql user group / user , data directory and the user directory
userdel mysql # delete user groupdel mysql # delete user group name mkdir / usr / local / default installation path mysql # mysql, it is recommended not to replace, if the replacement of the subsequent need to update the configuration mkdir / usr / local / mysql / the Data # in mysql folder create a folder under the Data groupadd mysql # create a user group named mysql useradd -r -g mysql mysql # create a user in the user group
5. decompress and transfer files MySQL
Tar-xzvf MySQL-5.7.17 #-Linux-glibc2.5- x86_64.tar.gz #-extracting file # cd MySQL -5.7.17-Linux-glibc2.5- x86_64 enter # # mv * / usr / local / MySQL / move files #
6. Change the permissions to enter the mysql directory
cd mysql/
chown -R mysql:mysql ./
7. Execute the installation script
./scripts/mysql_install_db --user=mysql
8. modified after installing the current directory to the root user owner, the owner of the directory data modified mysql
chown -R root:root ./
chown -R mysql:mysql data
9. Start MySQL
./support-files/mysql.server start
Successful start
If you start the MySQL error, it may be already exist MySQL process, can kill
10. Change mysql password
# MySQL after the start and then execute the following command to change the password: . / Bin / mysqladmin -u root -h localhost.localdomain password 'root'
11. Log in MySQL
# MySQL password to log in after changing
. / Bin / MySQL -h127.0.0.1-uroot--proot