In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Database
What is a database
A warehouse where data is stored
Data is organized and stored on the media in a specific format called a database.
Second, compare multiple database systems
A) there is no one of Oracle's best databases
B) SQL server's best database (windows)
C) MySQL Oracle sun open source
III. SQL language
A) SQL (structured query statement) Database Management system manages the data in the database through sql statements
1. Data definition language (DDL)
Used to define and manage data objects, including databases, data tables such as CREATE, DROP, etc.
two。 Data manipulation language (DML)
Used to manipulate all data in database objects such as INSERT UPDATE DELETE
3. Data query language (DQL)
Used to query all data in data objects such as SELECT
4. Data control language (DCL)
The language used to manage databases, including granting and changing permissions, database changes, such as GRANT
Why do we need to learn MySQL
I. MySQL is free
ii. Cross platform
iii. Powerful and convenient
Log in and log out of the mysql server
1. Login: the run box appears when you call windows key + r
3. Enter the following in the run box
1. Mysql-h localhost-uroot-p123456
2. Mysql-h localhost-uroot-p (recommended)
Password:*
3. Enter the password and enter enter using wamp- > mysql- > mysql console- >
4. Mysql-h localhost-uroot-p
-h hostname-u username-p password
Hostname: that's where you want to link to the database. Ip localhost is the local hostname. It can only be used locally.
Mysql-h 192.168.40.25
User name: root is the highest user in the database, super user.
Password: the default password is empty
5. If the file cannot be found by typing in the run box, do the following
Right click on the computer-> find Properties-> find Advanced system Settings-> Environment variables-> look for path above and below-> fill in the following on the path content-> (C:\ wamp\ bin\ mysql\ mysql5.7.11\ bin) you need to find your wamp path to copy and paste.
6. Quit
A) exit exit
B)\ Q exit
Note:
1. Each sql command needs to be done with a semicolon or with\ G
two。 You can split a command into multiple lines
3. You can cancel this line command through\ c
4. You can exit via exit or\ Q
We can use help through some shortcuts.
1. Set up the query results:\ G
two。 Cancel the operation that is currently completed:\ c
3. Exit the current client:\ Q
4. Show current server status:\ s
5. Display help information:\ h
View the database and create the database
i. View the database
SHOW DATABASES; (uppercase recommended)
ii. Create a database [] (square brackets represent writable but unwritable content is not a must)
CREATE DATABASE [IF NOT EXISTS] Database name (lowercase)
CREATE DATABASE IF NOT EXISTS ss21, if the database created does not exist, we create the database.
Select the database and view the data tables in the database
i. Select a database
USE database name
USE ss21
If you do not use the above command, the following error code will appear
ERROR 1046 (3D000): No database selected
ii. View data tables in the database
SHOW TABLES
IX. Delete database
DROP DATABASE [IF EXISTS] database name
For example, if DROP DATABASE IF EXISTS ss21; exists, we delete it.
Note:
1. Commands in MySQL database are not case-sensitive.
two。 Every time a database is created, a folder with the corresponding name is created in the data directory.
3. Database names are also case-insensitive under windows, but database names are strictly case-sensitive under linux.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.