Installing the JDK and MySQL in a Linux virtual machine

Source: Internet
Author: User
Tags mysql client mysql in iptables mysql login

Note: The Linux environment in this article is CentOS6.5 installed in a VMware virtual machine, and the installation steps in this article apply only to versions below CentOS7.0.

Below, enter the text.

First, install the JDK
    • Before installing the JDK, you need to check to see if the JDK is already installed on your system.

    • As you can see, the system already has jdk1.6 and jdk1.7 installed, so you need to uninstall the JDK that was already installed before installing it.

    • After uninstalling the installed JDK, upload the installation package for the JDK to be installed
    • Upload method:
      • Using a third-party upload plugin
      • Uploading files using the RZ command
    • To start the installation:
    • Some systems may need to rely on:
      • 1 Yum Install glibc.i686
    • To create a new JDK folder under/USR/LOCAL/SRC:

    • Unzip the uploaded JDK's tar package into the new JDK folder

    • Go to the/usr/local/src/jdk folder to see that the JDK has been unzipped to the folder

    • Configuring Environment variables
    • Open/etc/profile

    • Add the following code at the end line:
1 #set Java Environment 2 java_home=/usr/local/src/jdk/jdk1. 7 . 0_75 3 classpath=.: $JAVA _home/lib.tools.jar4 path= $JAVA _home/bin: $PATH 5 export Java_home CLASSPATH PATH
View Code
    • Save exit
    • Make the changed settings take effect immediately

    • To see if the JDK was installed successfully:

    • The result in the diagram shows that the JDK installation was successful!
Second, install MySQL
    • Installation dependencies:
1 Yum Install libaio.so. 1 libgcc_s.so. 1 libstdc++.so. 6 2 Yum  Update libstdc++-4.4. 7-4. el6.x86_643yuminstall libncurses.so. 5 libtinfo.so. 5
    • Install dependencies before installing MySQL, or it will fail to install
    • You need to uninstall MySQL that is already installed before you install MySQL
    • View the MySQL that is already installed

    • Uninstall MySQL

    • Check to see if there is a MySQL service again after uninstallation is complete

No results were found, which means that MySQL has been uninstalled.

    • Then continue with MySQL installation
    • Create a new MySQL folder under/USR/LOCAL/SRC:

    • Unzip the MySQL installation package to the installation path

    • Installing the MySQL server

    • Installing the MySQL Client

    • After the installation, check the MySQL login password:

As can be seen from the above image, MySQL password is randomly generated by the system, to see the need to/root/.mysql_secret file

    • View the/root/.mysql_secret file because the file is a hidden file, so you need to view it using the Ll–a command, or you won't see the hidden file

    • After you find the. mysql_secret file, view its default login password

    • MySQL service is off by default, view MySQL service

    • To start the MySQL service:

    • Connect to MySQL using the password found above:

    • After successful login, change password

    • To this, MySQL installation and reset password is completed, the next need to add MySQL to the system services, so that MySQL can start automatically as the system starts
    • Set the system to start automatically when MySQL starts:
    • Add to System services:
1 chkconfig--add MySQL
    • Auto Start:
1 chkconfig MySQL on
    • Query list:
Chkconfig

Note: No auto-start is not turned on (off).

    • Turn on MySQL remote connection and set remote access permissions:
    • Login:
Mysql–u root–p Root
    • To set up remote access (using the root password):
1 ' Root ' @'%'root'; 2 flush privileges;

    • Firewall Open Port 3306
1 3306 -J ACCEPT2 /etc/rc.d/init.d/iptables save3 /etc/init.d/ Iptables status

To this, MySQL installation is complete, you can use the Remote Link tool test, whether the normal link, if the normal link, then the installation is successful, if not, then carefully check the above installation steps, install again!

Installing the JDK and MySQL in a Linux virtual machine

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.