Some of the most important SQL commands
Connect to MySQL Server:
mysql -u UserName -p
Show Users:
SELECT user FROM mysql.user;
Show Users and Hosts:
SELECT user,host FROM mysql.user;
Change Password for User:
ALTER USER 'UserName'@'Host' IDENTIFIED BY 'NewPassword'; FLUSH PRIVILEGES;
write your question bellow in the “Leave a Reply” form.
Thanks!
MySQL is an open source, multi-dimensional, relational database management system. It is an essential tool for any webmaster/designer/developer, and to get started using it, one must understand the basic commands available.
The most commonly used MySQL command is SELECT, which lets you query a database table for specific information. This is followed by INSERT, which inserts values into an existing row in the database table. UPDATE is also used to modify an existing record in the database, while DELETE removes an entry from the table. Other commands are used to create, alter, or drop a table, query a database, control user access, and export and import data.
One of the most important MySQL commands is CREATE TABLE, which lets you add a new table to a database. This must be followed by the table name, the column names and the data types for each column. To delete a table, the DROP command is used. ALTER TABLE can be used to add, delete, modify, or rename a column within a table. The TRUNCATE command is used to delete all records from a table without dropping the entire table.
Once a table has been added, MySQL commands must be used to store, modify, and query data that is stored within the table. For example, the INSERT command is used to add a row to an existing table. The UPDATE command lets you modify existing values in the table, while SELECT is used to search for data within the table.
In addition to the above commands, there are many other MySQL commands that are commonly used. These may include commands to set up user accounts, create stored procedures, create triggers, export data, back up data, and more. MySQL commands should be learned and mastered by anyone who needs to manage or work with a complex database. With the help of these commands, a user can create and manipulate database tables, store and modify data, and query a database.