Install and use a MySQL database

Source: Internet
Author: User
With the development of the Internet and the increasingly active free software, more and more people begin to apply various databases to their own network applications. As a result, a variety of database systems appear on the Internet stage. The most common databases include MySQL of OReillyNetwork and PostgreSQL of PostgreSQLInc, which have different applications and applications on the Internet.

With the development of the Internet and the increasingly active free software, more and more people begin to apply various databases to their own network applications. As a result, a variety of database systems appear on the Internet stage. The most common databases include MySQL of o'reilly Network and PostgreSQL of PostgreSQL Inc, which have different applications and applications on the Internet.

With the development of the Internet and the increasingly active free software, more and more people begin to apply various applications to their own network. As a result, various systems appear on the Internet stage. The most common databases include MySQL of o'reilly Network and PostgreSQL of PostgreSQL Inc, which have different applications and user groups on the Internet. In addition, large databases such as oracle, sybase, and infomix are gradually transplanted to the Linux platform, which leads to increasingly diversified and specialized databases in Linux.

1. Why use the database?

To create an interactive site, you need to use the databaseStore information from visitors. For example, if you want to establish a site for professional services, you needStore information such as your resume and work you are interested in. You also need to use databases to create dynamic web pages. If you want to display the best jobs that meet the requirements of visitors, you need to retrieve the job information from the database. You will find that you need to use the database in many cases.

2. How to obtain database software

Currently, most popular Linux databases can be accessed over the INTERNET. You can use the following MySql databases:

Mysql: The latest mysql version is 3.23.22 until this book is published.

3. install and use mysql:

3. 1. Preparations before installation:

MySQL requires at least 2.0 Linux.

MySQL's Perl support must be Perl 5.004 _ 03 or updated.

There are two ways to install Mysql in Linux: 1) install the source code, and compile and install the tar package after installing mysql; 2) install the tar package in binary mode, install the binary file compiled by MYSQL mainly in the form of RPM.

Binary distribution is installed by decompressing the installation location you selected (typical "/usr/local/mysql") and creating the following directories (table. 1) here ):

Table. 1

Contents of the Directory

"Bin" customer program and mysqld

"Data" log files, databases

"Include" contains (header) files

"Lib" library file

"Scripts" mysql_install_db

"Share/mysql" error message file

"SQL-benchmark" benchmark program

Source code distribution is installed after you configure and compile it. By default, the installation procedure installs the file under "/usr/local ".ColumnDirectory (table. 2 ):

Table. 2

Contents of the Directory

"Bin" client programs and scripts

"Include/mysql" contains (header) files

"Info" Info format document

"Lib/mysql" library file

"Libexec" mysqld Server

"Share/mysql" error message file

"SQL-benchmark" benchmark program and crash-me test

"Var" database and log files.

In an installation directory, the source code installation layout is different from binary installation in the following aspects:

* The mysqld server is installed in the "libexec" directory instead of the "bin" directory.

* The data directory is "var" rather than "data ".

* Mysql_install_db is installed in the "/usr/local/bin" directory rather than "/usr/local/mysql/scripts.

* The header files and library directories are "include/mysql" and "lib/mysql", rather than "include" and "lib ".

. Use the mysql source package for Installation

You need the following tools to construct and install MySQLSource code:

* GNU gunzip unzip the distribution.

* A proper tar unpacking distribution. GNU tar is known to work.

* An ansi c ++ compiler that can run. Gcc> = 2.8.1, egcs> = 1.0.2, sgi c ++, and SunPro C ++ are some known working compilers. Libg ++ is not required when gcc is used. Gcc2.7.x has a bug that makes it impossible to compile some fully legal C ++ files, such as "SQL/SQL _base.cc ". If you only have gcc2.7.x, you must upgrade gcc to compile MySQL.

* An Excellent make program. GNU make is always recommended and sometimes required. If you have any questions, we recommend you try GNU make3.75 or update it.

* You must have the root permission of the system.

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.