mysql ddl is the abbreviation of data-defined language. Simply put, it is a language for creating, deleting, modifying and other operations on objects inside the database; DDL statements are mostly used by database administrators and developed Personnel are generally rarely used.
Recommended: "mysql video tutorial"
DDL statement
DDL is the abbreviation of data-defined language. Simply put, it is a language for creating, deleting, modifying and other operations on objects inside the database. The biggest difference between it and the DML language is that DML only operates on the internal data of the table, and does not involve the definition of the table, the modification of the structure, nor other objects. DDL statements are more commonly used by database administrators (DBAs) and are rarely used by developers.
The following uses some examples to introduce the use of commonly used DDL statements in MySQL.
1: Create a database
After starting the MySQL service, enter the following command to connect to the MySQL server:
mysql -uroot -p
The following interface will appear:
In the above command line, mysql represents the client command, "-u" is followed by the connected database user, and "-p" represents the password that needs to be entered.
If the database settings are normal and the correct password is entered, you will see the above welcome interface and a "mysql>" prompt. Several parts of the content are explained in the welcome interface.
. The end character of the command, end with ";" or "\g".
.The connection ID of the client. This number records the number of connections to the MySQL service so far; each new connection will automatically add 1.
.The version of the MySQL server, in this example 5.5.25.
. Use the "help" or "\h" command to display the help content, and use the "\c" command to clear the command line buffer.
Because all databases are stored in the database, So the first command you need to learn is to create a database.
The syntax for creating a database is as follows:
CREATE DATABASE dbname;
The above is the detailed content of What does mysql ddl mean?. For more information, please follow other related articles on the PHP Chinese website!