{"id":3945,"date":"2023-12-19T10:44:18","date_gmt":"2023-12-19T10:44:18","guid":{"rendered":"https:\/\/www.copahost.com\/blog\/?p=3945"},"modified":"2023-12-19T10:44:21","modified_gmt":"2023-12-19T10:44:21","slug":"main-mysql-commands","status":"publish","type":"post","link":"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/","title":{"rendered":"What are the main MySQL commands?"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"686\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/12\/Os-principais-comados-do-mysql-ingles-1-1024x686.png\" alt=\"Main commands of MySQL\" class=\"wp-image-3962\" srcset=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/12\/Os-principais-comados-do-mysql-ingles-1-1024x686.png 1024w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/12\/Os-principais-comados-do-mysql-ingles-1-300x201.png 300w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/12\/Os-principais-comados-do-mysql-ingles-1-768x514.png 768w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/12\/Os-principais-comados-do-mysql-ingles-1-84x55.png 84w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/12\/Os-principais-comados-do-mysql-ingles-1.png 1077w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>To make the most of the features of this database, it is important to know&nbsp;<strong>the main MySQL commands and operations<\/strong>.&nbsp;In this article, we will explore&nbsp;<strong>the main MySQL commands, from managing databases and tables, to creating and managing users and permissions<\/strong>.<\/p>\n\n\n\n<p>So, by the end of this article, we will&nbsp;learn MySQL&nbsp;using the basic commands and will have a solid understanding of the way they can be used to manage and optimize your database.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_69_1 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#Main_commands_for_managing_the_MySQL_database\" title=\"Main commands for managing the MySQL database\">Main commands for managing the MySQL database<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#Table_management_in_MySQL\" title=\"Table management in MySQL\">Table management in MySQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#Commands_for_users_and_permissions_in_MySQL\" title=\"Commands for users and permissions in MySQL\">Commands for users and permissions in MySQL<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Main_commands_for_managing_the_MySQL_database\"><\/span>Main commands for managing the MySQL database<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Database management is a fundamental aspect of&nbsp;MySQL&nbsp;as it allows the user to create, manage and modify the data stored in its database.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Create a database<\/h4>\n\n\n\n<p>To create a new database, the user can use the CREATE DATABASE command.&nbsp;Thus, this command allows you to set database configuration options such as the database name, header file location, and block page size.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE DATABASE database_name;<\/code><\/pre>\n\n\n\n<p>In the example, it creates a new database called \u201cdatabase_name\u201d.&nbsp;Thus, the \u201cCREATE DATABASE\u201d command is used to create a new database.&nbsp;So this command is used to create a new database.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Delete a database<\/h4>\n\n\n\n<p>To delete a database, the user can use the DROP DATABASE command.&nbsp;This command allows you to delete a specific database as well as all database objects associated with it.<\/p>\n\n\n\n<p>&nbsp;Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DROP DATABASE database_name;<\/code><\/pre>\n\n\n\n<p>This code deletes the database \u201cdatabase_name\u201d. Thus, the \u201cDROP DATABASE\u201d command is used to delete a database.&nbsp;This way, we use the command to delete a database.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Rename a database<\/h4>\n\n\n\n<p>To rename a database, the user can use the RENAME DATABASE command.&nbsp;Thus, this command allows you to change the name of an existing database to another name.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Change a database configuration<\/h4>\n\n\n\n<p>To change the configuration of a database, the user can use the ALTER DATABASE command.&nbsp;This allows you to change database configuration options such as the database name, header file location, and block page size.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ALTER DATABASE database_name\nADD FILENAME='file_location'\nWITH FILENAME = 'file_location';<\/code><\/pre>\n\n\n\n<p>This code changes the database \u201cname_of_the_bank_of_data\u201d by adding a new header file located in \u201cfile_location\u201d.&nbsp;Thus, the \u201c \u201d command&nbsp;<code>ADD FILENAME<\/code> adds a new file, and the \u201c<code>WITH FILENAME<\/code>\u201d parameter specifies the location of the added file.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Create a table<\/h4>\n\n\n\n<p>To create a new table, the user can use the CREATE TABLE command.&nbsp;Thus, this command allows you to define the table name, the table columns, and the data types for each column.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE nome_da_tabela (\n    column1 datatype,\n    column2 datatype,\n    column3 datatype\n);\n<\/code><\/pre>\n\n\n\n<p>This code creates a new table called \u201ctable_name\u201d with three columns: \u201ccolumn1\u201d, \u201ccolumn2\u201d and \u201ccolumn3\u201d.&nbsp;Each column has a data type specified in parentheses, such as \u201cdatatype\u201d.&nbsp;The \u201cCREATE TABLE\u201d command is used to create a new table.&nbsp;Parentheses are used to delimit the columns and data types in each column.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Delete a table<\/h4>\n\n\n\n<p>To delete a table, the user can use the DROP TABLE command.&nbsp;Thus, this command allows you to delete a specific table from the database.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DROP TABLE table_name;<\/code><\/pre>\n\n\n\n<p>This code deletes the table \u201ctable_name\u201d from the database.&nbsp;The \u201cDROP TABLE\u201d command is used to delete a specific table from the database.&nbsp;So this command is used to delete a table.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Rename a table<\/h4>\n\n\n\n<p>To rename a table, the user can use the RENAME TABLE command.&nbsp;This command allows you to change the name of an existing table to another name.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>RENAME TABLE table_name TO new_table_name;<\/code><\/pre>\n\n\n\n<p>This code renames the table \u201ctable_name\u201d to \u201cnew_table_name\u201d.&nbsp;Therefore, the \u201cRENAME TABLE\u201d command is used to change the name of an existing table.&nbsp;Parentheses are used to specify the new table name.&nbsp;This command is used to rename a table.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Change the structure of a table<\/h4>\n\n\n\n<p>To change the structure of a table, the user can use the ALTER TABLE command.&nbsp;In this sense, the command allows you to add, remove or modify columns from an existing table.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ALTER TABLE table_name\nADD column_new datatype;<\/code><\/pre>\n\n\n\n<p>This code adds a new column called \u201cnew_column\u201d to the \u201ctable_name\u201d table with the data type \u201cdatatype\u201d.&nbsp;Thus, we use the \u201cALTER TABLE\u201d command to modify the structure of an existing table.&nbsp;Parentheses are used to specify the table name and the new data type of the added column.<\/p>\n\n\n\n<p>In summary,&nbsp;MySQL offers a wide range of&nbsp;core commands to manage your databases and tables.&nbsp;With these commands, the user can create, delete, rename, and modify database objects, as well as change the configuration of a database.&nbsp;Thus, with these tools, the user can manage their information efficiently and effectively.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Table_management_in_MySQL\"><\/span>Table management in MySQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Table management is one of the most important features of&nbsp;MySQL.&nbsp;Tables store data in a database and allow you to query and manipulate data according to your needs.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Insert data into a table:<\/h4>\n\n\n\n<p>To insert data into a table, you can use the INSERT command.&nbsp;The INSERT command allows you to add one or more rows to a table.&nbsp;Thus, this way, the command would look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>INSERT INTO table_name (column_name1, column_name2, column_name3) VALUES (value1, value2, value3);<\/code><\/pre>\n\n\n\n<p>The statement \u201cINSERT INTO table_name\u201d indicates that the record will be inserted into the table called \u201ctable_name\u201d.&nbsp;Thus, the instruction specifies the names of the table columns, \u201ccolumn_name1\u201d, \u201ccolumn_name2\u201d and \u201ccolumn_name3\u201d, which will be filled with the values \u200b\u200b\u201cvalue1\u201d, \u201cvalue2\u201d and \u201cvalue3\u201d, respectively.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Update data in a table:<\/h4>\n\n\n\n<p>To update data in a table, you can use the&nbsp;<a href=\"https:\/\/www.copahost.com\/blog\/update-sql\/\">UPDATE<\/a>&nbsp;command.&nbsp;The&nbsp;<a href=\"https:\/\/www.copahost.com\/blog\/update-sql\/\">UPDATE<\/a>&nbsp;command allows you to change the value of one or more columns in one or more rows in a table.&nbsp;Thus, the command would look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>UPDATE table_name SET column_name = value WHERE condition;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Delete data from a table<\/h4>\n\n\n\n<p>To delete data from a table, you can use the&nbsp;<a href=\"https:\/\/www.copahost.com\/blog\/delete-into-sql\/\">DELETE<\/a>&nbsp;command.&nbsp;The&nbsp;<a href=\"https:\/\/www.copahost.com\/blog\/delete-into-sql\/\">DELETE<\/a>&nbsp;command allows you to delete one or more rows from a table.&nbsp;Thus, the command would look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DELETE FROM table_name WHERE condition;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Select data from a table<\/h4>\n\n\n\n<p>To select data from a table, you can use the SELECT command.&nbsp;The SELECT command allows you to select one or more columns from a table.&nbsp;Thus, the command would look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT column_name1, column_name2, column_name3 FROM table_name;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Sort data in a table:<\/h4>\n\n\n\n<p>To order data in a table, you can use the&nbsp;<a href=\"https:\/\/www.copahost.com\/blog\/order-by-sql\/\">ORDER BY<\/a>&nbsp;command.&nbsp;The&nbsp;<a href=\"https:\/\/www.copahost.com\/blog\/order-by-sql\/\">ORDER BY<\/a>&nbsp;command allows you to organize data in a table according to one or more columns.&nbsp;Thus, the command would look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT column_name1, column_name2, column_name3 FROM table_name ORDER BY column_name1 ASC;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Filter data in a table<\/h4>\n\n\n\n<p>To filter data in a table, you can use the WHERE command.&nbsp;The WHERE command allows you to select only those rows that match a specific condition.&nbsp;Thus, the command would look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT column_name1, column_name2, column_name3 FROM table_name WHERE column_name1 = 'value';<\/code><\/pre>\n\n\n\n<p>So, these are the main commands to manage tables in MySQL. With these commands, you can create, change, delete and query data in your database according to your needs.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><div class=\"wp-block-image is-style-rounded\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.homehost.com.br\/blog\/wp-content\/uploads\/2023\/07\/gustavo.jpg\" alt=\"autor gustavo\" class=\"wp-image-9582\" style=\"width:58px;height:auto\"\/><\/figure>\n<\/div><cite>A very important practice is&nbsp;<strong>to use indexes appropriately to optimize queries<\/strong>&nbsp;and perform&nbsp;<strong>regular backups of the database <\/strong>&#8211; <em>Comments&nbsp;<\/em>Gustavo Carvalho<\/cite><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Commands_for_users_and_permissions_in_MySQL\"><\/span>Commands for users and permissions in MySQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>User and permissions management is an important part of MySQL, as it allows you to control who has access to your tables and data.&nbsp;Thus, this way, we use the main MySQL commands to create, delete, edit and assign permissions to specific users to control access to your database.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Create a user:<\/h4>\n\n\n\n<p>To create a user in MySQL, you can use the GRANT command.&nbsp;The GRANT command allows you to assign privileges to a specific user.&nbsp;Thus, the command would look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>GRANT USAGE ON *.* TO 'user_name'@'localhost' IDENTIFIED BY 'password';<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Delete a user:<\/h4>\n\n\n\n<p>To delete a MySQL user, you can use the REVOKE command.&nbsp;The REVOKE command allows you to revoke privileges from a specific user.&nbsp;Thus, the command would look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>REVOKE USAGE ON *.* FROM 'user_name'@'localhost';<\/code><\/pre>\n\n\n\n<p>Where \u201cuser_name\u201d is the name of the user you want to delete.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Change a user&#8217;s permissions:<\/h4>\n\n\n\n<p>To change a user&#8217;s permissions in MySQL, you can use the GRANT command.&nbsp;In this sense, the GRANT command allows you to assign privileges to a specific user.&nbsp;Thus, the command would look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>GRANT ALL PRIVILEGES ON *.* TO 'user_name'@'localhost' IDENTIFIED BY 'password';<\/code><\/pre>\n\n\n\n<p>Where \u201cusername\u201d is the name of the user you want to change permissions and \u201cpassword\u201d is the password you want to associate with the user.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Assign permissions to a user:<\/h4>\n\n\n\n<p>To assign permissions to a user in MySQL, you can use the GRANT command.&nbsp;The GRANT command allows you to assign privileges to a specific user.&nbsp;Thus, the command would look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';<\/code><\/pre>\n\n\n\n<p>Thus, where \u201cusername\u201d is the name of the user you want to assign permissions to and \u201cpassword\u201d is the password you want to associate with the user.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Remove permissions from a user:<\/h4>\n\n\n\n<p>To remove permissions from a user in&nbsp;<a href=\"https:\/\/www.copahost.com\/blog\/postgresql-mysql-difference\/\">MySQL<\/a>, you can use the REVOKE command.&nbsp;Thus, the REVOKE command allows you to revoke privileges from a specific user.&nbsp;The command would look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>REVOKE SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX ON *.* FROM 'user_name'@'localhost';<\/code><\/pre>\n\n\n\n<p>Where \u201cusername\u201d is the name of the user you want to remove permissions from.<\/p>\n\n\n\n<p>These are the main commands to manage users and permissions in MySQL. So with these commands you can create users, delete users, change permissions, assign permissions and remove permissions from specific users.&nbsp;It&#8217;s important to remember that security is a critical part of any data management system, so it&#8217;s important to maintain control over access to your tables and data.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To make the most of the features of this database, it is important to know&nbsp;the main MySQL commands and operations.&nbsp;In this article, we will explore&nbsp;the main MySQL commands, from managing databases and tables, to creating and managing users and permissions. So, by the end of this article, we will&nbsp;learn MySQL&nbsp;using the basic commands and will [&hellip;]<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[91],"tags":[],"class_list":["post-3945","post","type-post","status-publish","format-standard","hentry","category-mysql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What are the main MySQL commands? - Copahost<\/title>\n<meta name=\"description\" content=\"Learn the main MySQL commands. Create, change and delete tables, records and indexes easily in your database!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What are the main MySQL commands? - Copahost\" \/>\n<meta property=\"og:description\" content=\"Learn the main MySQL commands. Create, change and delete tables, records and indexes easily in your database!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/\" \/>\n<meta property=\"og:site_name\" content=\"Copahost\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-19T10:44:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-19T10:44:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/12\/Os-principais-comados-do-mysql-ingles-1-1024x686.png\" \/>\n<meta name=\"author\" content=\"Schenia T\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Schenia T\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/\"},\"author\":{\"name\":\"Schenia T\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#\/schema\/person\/2efb96f9dfaf6162f347abcd06b1429f\"},\"headline\":\"What are the main MySQL commands?\",\"datePublished\":\"2023-12-19T10:44:18+00:00\",\"dateModified\":\"2023-12-19T10:44:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/\"},\"wordCount\":1561,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/12\/Os-principais-comados-do-mysql-ingles-1-1024x686.png\",\"articleSection\":[\"MySQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/\",\"url\":\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/\",\"name\":\"What are the main MySQL commands? - Copahost\",\"isPartOf\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/12\/Os-principais-comados-do-mysql-ingles-1-1024x686.png\",\"datePublished\":\"2023-12-19T10:44:18+00:00\",\"dateModified\":\"2023-12-19T10:44:21+00:00\",\"description\":\"Learn the main MySQL commands. Create, change and delete tables, records and indexes easily in your database!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#primaryimage\",\"url\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/12\/Os-principais-comados-do-mysql-ingles-1.png\",\"contentUrl\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/12\/Os-principais-comados-do-mysql-ingles-1.png\",\"width\":1077,\"height\":721},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.copahost.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What are the main MySQL commands?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#website\",\"url\":\"https:\/\/www.copahost.com\/blog\/\",\"name\":\"Copahost\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.copahost.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#organization\",\"name\":\"Copahost\",\"url\":\"https:\/\/www.copahost.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/03\/copahostlogo.png\",\"contentUrl\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/03\/copahostlogo.png\",\"width\":223,\"height\":40,\"caption\":\"Copahost\"},\"image\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#\/schema\/person\/2efb96f9dfaf6162f347abcd06b1429f\",\"name\":\"Schenia T\",\"description\":\"Data scientist, passionate about technology tools and games. Undergraduate student in Statistics at UFPB. Her hobby is binge-watching series, enjoying good music working or cooking, going to the movies and learning new things!\",\"url\":\"https:\/\/www.copahost.com\/blog\/author\/schenia\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What are the main MySQL commands? - Copahost","description":"Learn the main MySQL commands. Create, change and delete tables, records and indexes easily in your database!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/","og_locale":"en_US","og_type":"article","og_title":"What are the main MySQL commands? - Copahost","og_description":"Learn the main MySQL commands. Create, change and delete tables, records and indexes easily in your database!","og_url":"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/","og_site_name":"Copahost","article_published_time":"2023-12-19T10:44:18+00:00","article_modified_time":"2023-12-19T10:44:21+00:00","og_image":[{"url":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/12\/Os-principais-comados-do-mysql-ingles-1-1024x686.png"}],"author":"Schenia T","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Schenia T","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#article","isPartOf":{"@id":"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/"},"author":{"name":"Schenia T","@id":"https:\/\/www.copahost.com\/blog\/#\/schema\/person\/2efb96f9dfaf6162f347abcd06b1429f"},"headline":"What are the main MySQL commands?","datePublished":"2023-12-19T10:44:18+00:00","dateModified":"2023-12-19T10:44:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/"},"wordCount":1561,"commentCount":0,"publisher":{"@id":"https:\/\/www.copahost.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/12\/Os-principais-comados-do-mysql-ingles-1-1024x686.png","articleSection":["MySQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/","url":"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/","name":"What are the main MySQL commands? - Copahost","isPartOf":{"@id":"https:\/\/www.copahost.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#primaryimage"},"image":{"@id":"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/12\/Os-principais-comados-do-mysql-ingles-1-1024x686.png","datePublished":"2023-12-19T10:44:18+00:00","dateModified":"2023-12-19T10:44:21+00:00","description":"Learn the main MySQL commands. Create, change and delete tables, records and indexes easily in your database!","breadcrumb":{"@id":"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.copahost.com\/blog\/main-mysql-commands\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#primaryimage","url":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/12\/Os-principais-comados-do-mysql-ingles-1.png","contentUrl":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2023\/12\/Os-principais-comados-do-mysql-ingles-1.png","width":1077,"height":721},{"@type":"BreadcrumbList","@id":"https:\/\/www.copahost.com\/blog\/main-mysql-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.copahost.com\/blog\/"},{"@type":"ListItem","position":2,"name":"What are the main MySQL commands?"}]},{"@type":"WebSite","@id":"https:\/\/www.copahost.com\/blog\/#website","url":"https:\/\/www.copahost.com\/blog\/","name":"Copahost","description":"","publisher":{"@id":"https:\/\/www.copahost.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.copahost.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.copahost.com\/blog\/#organization","name":"Copahost","url":"https:\/\/www.copahost.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.copahost.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/03\/copahostlogo.png","contentUrl":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/03\/copahostlogo.png","width":223,"height":40,"caption":"Copahost"},"image":{"@id":"https:\/\/www.copahost.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.copahost.com\/blog\/#\/schema\/person\/2efb96f9dfaf6162f347abcd06b1429f","name":"Schenia T","description":"Data scientist, passionate about technology tools and games. Undergraduate student in Statistics at UFPB. Her hobby is binge-watching series, enjoying good music working or cooking, going to the movies and learning new things!","url":"https:\/\/www.copahost.com\/blog\/author\/schenia\/"}]}},"_links":{"self":[{"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/posts\/3945","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/comments?post=3945"}],"version-history":[{"count":3,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/posts\/3945\/revisions"}],"predecessor-version":[{"id":3963,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/posts\/3945\/revisions\/3963"}],"wp:attachment":[{"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/media?parent=3945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/categories?post=3945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/tags?post=3945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}