The basics of MySQL knowledge points for the second-level computer exam, common MYSQL commands, as follows Commonly used MYSQL commands (add computer secondary sites to favorites) Start: net start mySql; Enter: mysql -u root -p/mysql -h localhost -u root -p databaseName; List databases: show databases; Select database: use databaseName; List tables: show tables; Create a data table: mysql> CREATE TABLE mytable (name VARCHAR(20), sex CHAR(1), -> birth DATE, birthaddr VARCHAR(20)); Display the properties of table columns: show columns from tableName; Modify the table structure: DESCRIBE mytable; Create a database: source fileName.txt; Matching characters: You can use the wildcard character _ to represent any character, and % to represent any string; Add a field: alter table tabelName add column fieldName dateType; Add multiple fields: alter table tabelName add column fieldName1 dateType,add columns fieldName2 dateType; Multi-line command input: Note that words cannot be broken; when inserting or changing data, the string of the field cannot be expanded to multiple lines, otherwise the hard return will be stored in the data; Add an administrator account: grant all on *.* to user@localhost identified by "password"; After entering each statement, add a semicolon ';' at the end, or add '\g'; Query time: select now(); Query the current user: select user(); Query the database version: select version(); Query the currently used database: select database( ); The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. Finally, I wish you all success in passing the computer level test. You may also be interested in:
|
<<: Security configuration and detection of SSL after the website enables https
>>: A record of pitfalls in JS regular matching
Table of contents Image capture through svg CSS p...
After the image is built successfully, it can be ...
Table of contents MAH 1. Introduction to MAH Arch...
This article shares with you the solution to the ...
Ubuntu 16.04 installs the PHP7.0 environment by d...
<br />"There are no ugly women in the w...
Copy code The code is as follows: height:auto !im...
As shown below: //Query the year and month of the...
Table of contents 1. Why do we need vue3? 2. Adva...
Preface Share two methods to monitor whether an e...
Prelude We all know that nginx is an excellent re...
Demand background The project is made using Vue, ...
Friends always ask me how to hide Linux processes...
1. Installation package preparation VMware-player...
nginx Overview nginx is a free, open source, high...