Java Development on Linux

Source: Internet
Author: User

After the Linux system is installed by default, there is no built-in database software, which does not meet our needs for Java EE development. Therefore, we need to install the database software by ourselves. Of course, the first choice is MySQL. Although MySQL 4.0 RPM is available on the tool CD of the red flag, I still choose MySQL 5.0. You can download the latest version of the software from the official MySQL website.

On the download page, we can see that 5.1 is a beta version and 6.0 is an alpha version. Therefore, we do not need to pursue the latest version, so we can use 5.0. MySQL has been divided into community edition and Enterprise Edition since version 5.0. Of course, Enterprise Edition requires money, so we can only select community edition.

There are also many packaging methods for MySQL. You can directly download the source code, compile it yourself, or download the RPM package for a specific Linux system. I chose a non-rpmpackage. Download a compressed file named mysql-5.0.45-linux-i686.tar.gz with the size of 77.5 MB. Of course, you can also choose the RPM package For Red Hat Enterprise Linux 4, because the Red Hat Linux system was declared compatible with the Red Hat RPM package when it was released, and the tool CD provided by the Red flag was used, I have seen many software packages in RHEL 4, so I can be sure that red-flag Linux supports at least the RPM package in RHEL 4.

If the RPM package is used, it is easy to install it. Unfortunately, the Server, Client, and other libraries are packaged separately, which is troublesome to download. However, it is much easier for me to download a single compressed file. However, after decompression, some settings are required for use.

1. decompress the compressed package and place it in the/usr/mysql directory.
2. Create a mysql user
3. Run mysql_install_db to initialize the database.

During the setup process, we can also see that MySQL data will be stored in the/usr/mysql/data directory, and before the database initialization, the/usr/mysql/data/mysql directory is empty and does not contain any table files.

After the settings are complete, you can use. /bin/mysqld_safe to start the database server. You must note that the -- user = mysql parameter is specified for both database initialization and database server startup, that is to say, let them run with mysql users, which is mainly from the security aspect. After the server is started, use./bin/mysqladmin to set the password of the root account, and finally use./bin/mysql to connect to the server, you can use various database operations.

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.