MySQL database (1) _mysql Database Introduction and Installation

Source: Internet
Author: User
Tags ibm db2 mysql client

I. Introduction to database-related concepts

  A database (DATABASE,DB) is a collection of organized, shareable data that is stored in a computer for a long period of time. The data in the database is organized, described and stored in a certain mathematical model, with small redundancy, high data independence and extensibility, and can be shared by various users.

  Database Management System is a large-scale software that manipulates and manages databases for the establishment, use, and maintenance of databases, referred to as DBMS. It has unified management and control of the database to ensure the security and integrity of the database. The user accesses the data in the database through the DBMS, and the database administrator maintains the database through the DBMS. It allows multiple applications and users to create, modify, and interrogate databases in different ways, at the same time or at different times. Most DBMS provides data definition language (Language) and data-manipulation language (manipulation Language), which allows users to define schema structure and permissions constraints of the database, to append the data, Delete operations.

Database management system is the core of database system and the software of managing database. Database management system is to realize the user's meaning of abstract logical data processing, transformation into a computer-specific physical data processing software. With a database management system, users can manipulate the data in an abstract sense without having to take into account the layout and physical location of the data in the computer.

Common database management software: Oracle's ORACLE,IBM db2,sql server, Access,mysql (open source, free, cross platform).

  The Database systems DBS (data Base system, or DBS) is typically comprised of software, database, and data administrators. Its software mainly includes operating system, various host languages, utilities and database management system. The database is managed by the database management system, and the data inserting, modifying and retrieving are all through the database management system. The Data Manager is responsible for creating, monitoring, and maintaining the entire database so that the data can be used effectively by anyone who has access to it.

Ii. SQL statements

  SQL is an abbreviation for Structured Query Language(Structured Query language). SQL is a set of operational commands built for the database and is a fully functional database language. When using it, only the "What to Do" command is issued, "How to Do" is not considered by the user. SQL is powerful, easy to learn and easy to use, and has become the foundation for database operations, and now almost all databases support SQL.

SQL specification

<1> in a database system, SQL statements are case-insensitive (uppercase is recommended). However, string constants are case-sensitive. Recommended command uppercase, table name Library name lowercase;

<2> SQL statements can be written in single or multiple lines, with ";" End. Keywords cannot span multiple lines or abbreviations.

<3> use spaces and indents to improve the readability of the statement. Clauses are usually located on separate lines, making editing easier and more readable.

  <4> Note: single-line Comment:--

Multi-line Comment:/*......*/

<5>sql statement can be wrapped

Third, MySQL installation

1. DownloadMySQL Community Server 5.7.19

  http://dev.mysql.com/downloads/mysql/

2. Installation

Linux:yum Install Mysql-server

Windows: Way one: Dot Dot

Windows Installation Method Two:

1) Unzip: If you want MySQL to be installed in the specified directory, then move the extracted folder to the specified directory, such as: C:\mysql-5.7.16-winx64

2) Initialize:

        cd c:\mysql-5.7.16-winx64\bin

        mysqld --initialize-insecure

3) Start the MySQL service

      # 进入可执行文件目录  cd c:\mysql-5.7.16-winx64\bin

      # 启动MySQL服务   mysqld    (带d结尾的为数据库服务端文件,没有d的为客户端文件)4) Start the MySQL client and connect to the MySQL service: The default password is not set to the root account due to the "mysqld--initialize-insecure" command used during initialization     

      # 进入可执行文件目录 cd c:\mysql-5.7.16-winx64\bin

      # 连接MySQL服务器  mysql -u root -p

      # 提示请输入密码,直接回车

Input enter, see the installation success: Iv. mysql Add environment variable

After the MySQL server has been installed successfully, and the client is already able to connect, and then operate MySQL later, only need to repeat the above 3, 4 steps. However, in the 3, 4 steps of repeated access to the executable directory is cumbersome, if you want to be easy to operate later, you can do the following operations.

1. Add Environment variables

"Right-click Computer"-"Properties"-"Advanced system Settings"-"Advanced"-"Environment variable"-"in the second content box to find the variable named path of a row, double-click"-"the MySQL Bin directory path appended to the variable value, with;

After adding the environment variable, start the MySQL server and the client does not need to switch directories, the direct output command:

# to start the MySQL service, enter Mysqld # on the terminal to connect the MySQL service in terminal input: Mysql-u root-p

  

2. Create a MySQL service as a Windows service

The previous step solves some problems, but is not exhaustive, because the current terminal will be stuck while executing "MYSQD" to start the MySQL server, then do the setup to resolve the problem:

# make MySQL Windows service, execute this command at Terminal: "C:\mysql-5.7.16-winx64\bin\mysqld"--install # Remove the MySQL Windows service and execute this command at the terminal: "C \ Mysql-5.7.16-winx64\bin\mysqld "--remove

After registering as a service, you only need to execute the following command when you start and close the MySQL service later:

# Start MySQL service net start MySQL # close MySQL service net stop MySQL

The MySQL database is now installed!

MySQL database (1) _mysql Database Introduction and Installation

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.