Special commands in MySQL database query: mysql DataBase Query
1. Install MySQL
Download the MySQL software and modify the installation path.
Install database MySQL5.7.18
Step 1: Database MySQL5.7.18 can download the corresponding version on the official website: http://www.filehorse.com/download-mysql-64,
Step 2: extract the downloaded installation package to a disk,
Step 3: configure the environment variable, create the environment variable MySQL_HOME, and enter the installation directory of MySQL,
Then insert % MYSQL_HOME % \ bin to the end of Path;
Step 4: run the command line as an administrator, press win + R and Enter cmd, right-click and run the command as an administrator.
Step 5: switch to the MySQL installation directory and use mysqld for installation:
Initialization data: mysqld -- initialize-insecure -- user = mysql,
Start the service: mysqld -- user = mysql,
Initialize mysql root password mysqladmin-u root password 'new-password ',
For more information, see https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization-mysqld.html.
Step 6: register the service mysqld -- install MySQL
Use the net start mysql command to start the service.
Enter the mysql-u root-p command, and then enter the password entered during database initialization in step 5, as shown in:
Run the mysql Command show databases; To View tables in the database, as shown in:
This indicates that the database has been installed successfully.
Second: Special Database Query statements
In descending order, select name from data order by name desc; ---- Here, desc means sorting in descending order.
For a query of relative column positions, select name, price from data order by; ----- here, 2 and 3 indicate sorting by the second column and then by the third column.
Note: To sort multiple columns in descending order, desc must be used for each column.
Third:
What is the difference between creating a link for Navicat database software and creating a database?
Creating a link is to create a data link object that contains a database
To create a data link
Select the database link type. For MySQL, set the Link name and password port number.
Create Database in e-MySQL
In this way, the database will be created.