Centos 6.5 Install Mysql 8.0.0

Source: Internet
Author: User
Tags mkdir

Dependency Packages
Yum install numactl Libaio perl-time-hires per-devel-y

Download the corresponding system version download
wget http://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.11-linux-glibc2.12-i686.tar.gz

uninstalling the system comes with MySQL

Rpm-qa | grep MySQL

If the system has, delete: Rpm-e--nodeps mysql-libs-5.1.71-1.el6.x86_64

the downloaded files are moved to the Linux server directory and extracted

Mkdir/usr/local/mysql

Mkdir/usr/local/data

Tar zxvf mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz-c/usr/local/mysql/

create MySQL user groups and MySQL users, and make MySQL the owner of the directory/usr/local/mysql

Groupadd MySQL

Useradd-r-G MySQL MySQL

Chown-r Mysql:mysql/usr/local/mysql

Initialize the database, generate [email protected] and password, write down the password

     /usr/local/mysql /bin/mysqld--initialize--user=mysql (username created by yourself) -- Basedir=/usr/local/mysql/ -- datadir=/usr/local/mysql/data/

start the MySQL service and check if the service started successfully  

    /usr/local/mysql/bin/mysqld_safe--user=mysql (user name created by yourself) &  //start

Ps-ef | grep mysql//view MySQL service process

Password change and remote login

/usr/local/mysql/bin/mysql-u root-p

Enter the temporary password you just generated

Use MySQL;

ALTER USER ' root ' @ ' localhost ' identified by ' 123456 '; Change Password

Update user Set host = '% ' where user = ' root '; Allow remote access

Resolve Navicat Connection 1251 Error

   This is because the encryption rule in the previous version of Mysql8 is Mysql_native_password, and after mysql8, the encryption rule is Caching_sha2_password, There are two ways to solve the problem          one is to upgrade the Navicat driver, one is to restore the MySQL user login password encryption rule to Mysql_native_ password. 

        lter USER ' root ' identified by ' password ' password EXPIRE never; modify encryption rules  

        alter USER ' root ' identified with Mysql_native_ Password by ' 123456 '; // update the user's password  

        flush privileges; #刷新权限

add MySQL service to system services     

Cp-a/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld

< Span style= "Font-family:consolas, Inconsolata, Courier, monospace" >         chmod +x/etc/ rc.d/init.d/mysqld    

Chkconfig--add mysqld

Check if it takes effect

Chkconfig--list mysqld

You can then use the Service command to control the start and stop of MySQL, with the command: Service mysqld start and service mysqld stop

Configuring environment Variables

VI /etc/profile//Last added

Path=/usr/local/mysql/bin:/usr/local/mysql/lib: $PATH

Source/etc/profile//Immediate effect

Centos 6.5 Install Mysql 8.0.0

Related Article

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.