MySql For Mac

  • Download software for mac from website
  • You can operate mysql by [sequel ace] software or console.
  • If you use console, you may start mysql service. And then, you should write [mysql -u root -p] to link database.

    MySql For Windows

  • You can refer to this article for the installation of Mysql under Windows.(https://zhuanlan.zhihu.com/p/392278349)

    MySql Support Website

    You can download the script from this site(http://forta.com/books/0672327120/) to create the database, but you need to set one database as default schema.
    image.png

    Database defined

    A database is an organized collection of structured information, or data, typically stored electronically in a computer system. A database is usually controlled by a database management system(DBMS). Together, the data and the DBMS, along with the applications that are associated with them, are referred to as a database system, often shortened to just database.
    Data within the most common types of databases in operation today is typically modeled in rows and columns in a series of tables to make processing and data querying efficient. The data can then be easily accessed, managed, modified, updated, controlled, and organized. Most databases use structured query language(SQL) for writing and querying data.

  • Table: A table is a collection of related data held in a table format within a database. It consists of columns and rows.

  • Schema: The database schema is its structure described in a formal language supported by the database management system. Information about the layout and characteristics of databases and tables.
  • Column and Row
  • Primary Key: A primary key is a special relational database table column ( or combination of columns) designated to uniquely identify each table record. A primary key is used as a unique identifier to quickly parse data within the table. A table cannot have more than one primary key.

    What is Structured Query Language(SQL)?

    SQL is a programming language used by nearly all relational databases to query, manipulate, and define data, and to provide access control. SQL was first developed at IBM in the 1970s. SQL has spurred many extensions from companies such as IBM, Oracle, and Microsoft.

    Use MySQL

  • Open [MySQL Command Line Client]

  • Input password
  • Input [show databases\g]

image.png

  • Input [show tables from ef\g]

image.png

  • Input [show columns from ef.products\g == describe ef.products\g]

image.png

  • [show status] [show create database/table] [show grants] [show errors/warnings]
  • Input [help show]

image.png

Practice online

牛客网