CentOS 6.6 MySQL 8.0 Detailed installation steps

Source: Internet
Author: User

    • 1. Back up the MySQL database on the server
[[email protected] ] # mysqldump -h localhost -u root -proot --databases Surpass --routines > /home/SQLBackup/Surpassme_20180801.sql
    • 2. View the SQL script after backup
[[email protected] ] # du -sh /home/SQLBackup/Surpassme_20180801.sql200M Surpassme_20180801.sql
    • 3, query server installation of MySQL
[[email protected] ] # rpm -qa | grep -i mysql  MySQL-client-5.6.38-1.el6.x86_64  MySQL-server-5.6.38-1.el6.x86_64  MySQL-devel-5.6.38-1.el6.x86_64
    • 4. Stop MySQL Service
[[email protected] ] # service mysql stop
    • 5. Uninstall the already installed MySQL
[[email protected] ] # yum -y remove MySQL-*
    • 6. Find the remaining MySQL files
[[email protected] ] # find / -name mysql/var/lib/mysql/usr/lib64/mysql
    • 7,/var/lib/mysql for this MySQL data directory, it is recommended to install the first backup
[[email protected] ] # mv /var/lib/mysql /var/lib/mysql20180801
    • 8. Remove the legacy files from the previous version of MySQL
[[email protected] ] # rm -rf /usr/lib64/mysql
    • 9. Backing Up/ETC/MY.CNF files
[[email protected] ] # mv /etc/my.cnf /etc/my.cnf.bak20180801
    • 10. Upload the MySQL 8.0 compression package to the server
    • 11. Create an extract directory and unzip it
[[email protected] ] # mkdir -p /home/MySQL8.0[[email protected] ] # tar -xf mysql-8.0.11-1.el6.x86_x64.rpm-bundle.tar -C /home/MySQL8.0
    • 12. Install MySQL 8.0
[[email protected] ] # rpm -ivh mysql-community-{server,client,common,libs}-8.0.11-1.el6.x86_64.rpm
    • 13. Configure the MySQL configuration file
[[email protected] ] # vim /etc/my.cnf

This step is very important, there are some configuration parameters in MySQL 8.0 can only be configured and changed before initializing the database, do not support the initialization after the change, such as ignoring the case configuration is the case, lower_case_table_names

    • 14. Initialize MySQL
[[email protected] ] # mysqld --initialize
    • 15. Modify MySQL DataDir permissions
[[email protected] ] # chown -R mysql:mysql /var/lib/mysql
    • 16. Start the MySQL service
[[email protected] ] # service mysqld start
    • 17. Check the root user password after initialization
[[email protected] ] # grep ‘temporary password‘ /var/log/mysqld.log
    • 18, change the root password, and set the appropriate permissions

    • 19. Log in to MySQL
[[email protected] ] #  mysql -h localhost -u root -p
    • 20. Allow the process to Telnet

    • 21. Restore Data Database
[[email protected] ] # mysql -h localhost -u root -p < /home/SQLBackup/Surpassme_20180801.sql

This article is posted on the subscription number, such as your friends like my article, you can also follow my subscription number: Woaitest, or scan the following QR code to add attention:

CentOS 6.6 MySQL 8.0 Detailed installation steps

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.