MySQL - Windows console commands

The development of information technology is one of the foremost areas of human activity. Therefore, a huge amount of money is invested in this area. From the beginning to the present day, many different tasks have been solved that have greatly facilitated the daily lives of many people. However, with the development of technology, a number of problems arose, one of which was the excessive amount of information to be stored. Databases were designed to resolve the situation.

A brief overview of database management systems

Since the problem of storing a large amount of information is relevant today, there are several solutions. Each of them is focused on tasks of a certain orientation. However, together they form a full-fledged complex, which allows us to simplify the problem of data storage.

mysql console commands

There is a certain classification that determines the need to use one or another database and DBMS (database management system). The most common currently considered client-server data storage technology. They include the following types: Firebird, Interbase, IBM DB2, MS SQL Server, Sybase, Oracle, PostgreSQL, LINTER, MySQL. We will be interested in the last option - MySQL, whose commands are fully consistent with SQL standards. This technology is one of the most popular and often used to solve both local applied and production problems of small scale.

Mysql team

The predecessors of client-server technology are file-server DBMSs, which have lost their position due to a number of shortcomings, among which are the need to distribute the DBMS kernel on each computer and a significant load on the local network, which leads to an increase in time costs. This group includes Microsoft Access, Borland Paradox.

New technologies are gaining popularity

However, several years ago, advanced technology appeared that is gaining popularity and is in demand in solving small local problems. We are talking about embedded database management systems. The main feature of the DBMS under consideration is the lack of a server part. The system itself is a library that allows a unified way to work with large volumes of information placed on a local computer. This method eliminates the disadvantages of file-server tools, and also significantly exceeds the speed of client-server technology.

ySql console command

Examples include OpenEdge, SQLite, BerkeleyDB, one of the Firebird, Sav Zigzag, Microsoft SQL Server Compact, LINTER variants, as well as one of the MySQL variants, whose commands are no different from those used in client-server DBMSs. However, embedded systems can easily lose their relevance if the task ceases to be local in nature.

Key Benefits of MySQL Database Engine

MySQL database management system is one of the most popular technologies, as it can be used to solve a huge number of tasks. If we compare it with modern analogues, we can distinguish a number of main advantages.

The main advantage in the Russian market is its availability, since it is free in most cases. The second feature is speed. One of the most popular systems is MySQL. Commands in it are executed quickly, with minimal response time. It does not affect the speed of processing commands connecting several clients to the server in multithreaded mode due to the use of InnoDB mechanism for fast transaction support.

Mysql linux command

The presence of an ODBC driver makes it easier for developers to solve many problems. The advantages also include the availability of the possibility of recording fixed and variable lengths. But the main function, which is very much appreciated among programmers, is the interface with the languages ​​C and PHP. The capabilities provided by MySQL have allowed the use of this DBMS for a huge number of Internet hosting service providers.

And for a simple layman who is interested in modern information storage technologies, it is necessary to study MySQL, SQL commands and their syntax because specialists in this area are widely in demand and highly paid anywhere in the world. Therefore, if anyone is interested in this area, do not hesitate. You need to move on to learning right now.

What you need to study

At first glance, it may seem that this area is difficult to study independently and requires constant communication with a specialist. However, this is not the case. You can study the architecture and features of MySQL, the basic commands of the query language, and everything related to it, without resorting to the help of a consultant. To do this, it is enough to have a desire and make efforts in order to move on. Only self-development and study of this area will allow to acquire new knowledge, consolidate acquired skills and, possibly, begin to build a career and move in this direction.

MySql console command

To learn the basic commands, first of all, you need to have at hand a free version of the console utility MySQL. It is with her that the learning process begins. You can download it from the official MySQL site. It is easily installed on any operating system, forming the server and client on one computer, which is very convenient.

Then you need to resort to finding a training manual that contains basic information about the MySQL environment. Console commands for basic learning, as a rule, are also contained in them. There is a lot of information about this. However, the choice must be taken seriously. Information should be presented sequentially and clearly structured.

If you have basic knowledge of English, you can use the support built into the console. There is a special help command for this, which helps to understand the use of the MySQL utility.

Basic console commands

Moving smoothly from the main features, capabilities and advantages, we got to the list of basic commands. The MySQL utility initially contains only one user, which is just used for learning. This is a user with the root name whose password is completely identical to the name.

At the first and subsequent launches of the MySQL console, the user will need to enter the root password for further work with the MySQL DBMS. Console commands will be available only after authentication.

mysql basic commands

After successful verification, for convenience, you can display existing commands using the help command. After that, all existing commands and a brief description of them will be presented on the console.

Control and display commands

Now you need to go to the next step. To do this, select an existing one or create a new database. To select an existing database, use the use command. And enter the database name after a space. Initially, there is only one in the utility - with the name test . Therefore, the query will look like this: use test .

To create a database, you must use the create command, specifying the database keyword and specifying the appropriate name. The structure will take the following form: create database Name_of_database . To work with the created database, you need to access it using the use command.

MySql Windows console command

The environment provides a function designed to display existing databases, tables, primary keys or foreign relations and display information about them on the MySQL console. Commands in this case should always begin with a show clause. For example, in order to display a list of available databases for the current user, just enter the following query: show databases . To display a table, it is enough after the keyword to change the display object by entering tables .

Table Management Commands

Before moving on, it is necessary to remind once again that compliance with SQL standards provides wide opportunities for developers, regardless of the DBMS and operating systems used. Queries developed in any environment that supports the SQL standard will successfully execute (if there is a database and tables) in the MySQL environment. Windows console commands are no different from those used on other operating systems.

To work with tables, there are a number of specific commands that, if translated from English, speak for themselves. The create command was mentioned above. It can also be used to add tables to a previously created database. To delete database objects, in particular tables, the drop command is used, to which the name of the destroyed object is added. Example: drop name _ of _ your _ table .

The syntax for accessing the database server always has a common structure. Therefore, a query developed in Windows will also successfully execute in the MySQL Linux console. Commands processed by the server without errors in one operating system cannot cause errors in others.

Select Command

But the most important command for working with tables, the syntax of which is quite simple, is the select command. It is it used to select data from the database. The initial syntax has the following structure: select * from table _ name . By sending such a request to the database server, the client should receive all the records stored in the table.

mysql php commands

Many never think, but when browsing Internet resources, MySQL commands are constantly used. PHP queries use SQL syntax to display the contents of online store catalogs or news on social networks. Instead of the “*” sign after the select clause, as a rule, a list of the main fields of the table or several tables is given, the data from which must be processed. In the case of sampling from several tables, a special join is used , which serves to join them using existing external links. However, this condition can be changed by independently specifying which fields should be used for communication.

Setting Sampling Constraints

Sometimes a situation occurs when the response received from the database server contains duplicate data. In order for the user to see only unique entries, the distinct clause is used. It is placed in front of the list of requested fields and serves as an aid to hide duplicates.

Source: https://habr.com/ru/post/A14106/


All Articles