Installing mysql5.7 and JDK 1.8 under CENTOS7

Source: Internet
Author: User

Installing mysql5.7

Specific installation procedures can be found at the official website: A Quick Guide to Using the MySQL Yum Repository

    1. Go to the /usr/local/src folder.
cd /usr/local/src
    1. Download the required RPM warehouse files on the website, then upload the files to the /usr/local/src folder, or use mget direct access.
    2. Install the downloaded RPM package.
rpm -Uvh mysql80-community-release-el7-1.noarch.rpm
    1. Using the yum repolist all | grep mysql view MySQL release version, the current valid version is 8.0.
yum repolist all | grep mysql
    1. Use yum-config-manager the command to set the valid version of MySQL to 5.7. If you do not have the installation yum-config-manager yum-utils package installed.
#使用yum seach命令查找yum-config-manager所在的包。yum search yum-config-manager#经查询发现yum-config-manager在yum-utils包中,使用yum install进行安装。yum install yum-utils#禁用mysql 8.0yum-config-manager --disable mysql80-community#启用mysql 5.7yum-config-manager --enable mysql57-community#再次确认mysql的版本yum repolist all | grep mysql
    1. If you do not use yum-config-manager a command, you can also manually edit the /etc/yum.repos.d/mysql-community.repo file to set a valid version.
vi /etc/yum.repos.d/mysql-community.repo#/etc/yum.repos.d/mysql-community.repo[mysql57-community]name=MySQL 5.7 Community Serverbaseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/#可以设置enabled为1,将当前设置设置为有效。enabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
    1. Install MySQL.
yum install mysql-community-server
    1. Start the MySQL service to view the MySQL status.
#启动mysql服务systemctl start mysqld.service#设置mysql服务开机启动systemctl enable mysqld.service#查看mysql服务状态systemctl status mysqld.service
    1. View the MySQL temporary password.
grep ‘temporary password‘ /var/log/mysqld.log
    1. Log in to MySQL and modify the MySQL password.
mysql -uroot -pALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘MyNewPass4!‘;
    1. You can use the following command to view additional MySQL-related installation packages and then use the yum install 包名 installation for the package.
yum --disablerepo=\* --enablerepo=‘mysql*-community*‘ list available
    1. The MySQL configuration file is stored in and /etc/my.cnf you can view and modify the MySQL configuration.
Installing JDK 1.8
    1. Use yum search java|grep jdk the commands to view JDK-related packages.
    2. Install the corresponding JDK package.
yum install java-1.8.0-openjdk
    1. Configure the Java environment variables.
vi /etc/profile#在profile文件中添加如下内容#set java environmentJAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64JRE_HOME=$JAVA_HOME/jreCLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/libPATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/binexport JAVA_HOME JRE_HOME CLASS_PATH PATH
    1. Let the changes take effect.
source /etc/profile

Installing mysql5.7 and JDK 1.8 under CENTOS7

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.