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 Introduction to Arrays Array li...
Today we will make a simple case, using js and jq...
They are all web page templates from the foreign ...
Usage scenario: We use Alibaba Cloud and purchase...
Messy log Nginx in daily use is mostly used as bo...
How to install flash in Linux 1. Visit the flash ...
stat function and stat command Explanation of [in...
Preface Usually when making h5 pages, you need to...
This article describes how to use docker to deplo...
Preparation 1. Start the virtual machine 2. git t...
This article example shares the specific code of ...
I recently wrote a combination of CSS3 and js, an...
The Docker Hub we used earlier is provided by Doc...
1. Download the software 1. Go to the MySQL offic...
The first time I wrote a MySQL FUNCTION, I kept g...