In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Change the database password:
[root@svr ~] # mysqladmin-uroot-p (old password) password 'new password'
Set font format utf8
[root@svr ~] # vim / etc/my.cnf
Character_set_server=utf8
Access to the database
Mysql-uroot-ppwd@123 (there can be no spaces in the middle. If there are spaces, they will be considered to be followed by a database)
The database statement ends with a semicolon or\ g
View the database table show databases
Use database: use database name
View database tables: show tables
Creating a database create database ntdad1903; database name cannot be a pure number (some versions cannot start with a number) and cannot be a keyword
Delete database drop database library name
Create a database table
Create table table name (column name type (length), column name type (length),... .)
Describe base; View Database description
Insert data into the table:
The Insert into table name is values ('value 1', 'value 1', 'value 2'... ); (the value value corresponds to the table field)
Delete only one piece of data:
Form copy use an existing form to copy a new form
Create a new table with reference to the original table structure
Change the table structure:
Alter table table name modify column name character type (length); redefine character length
Alter table table name modify column name character type (length) frist; definition column is placed first
Alter table table name modify column name character type (length) after column name; define the position of the column after a column
Alter table table name change old column name new column name
Insert multiple pieces of data at a time
Select select select query to extract the desired content from the data table
1. Select all records in the table
Select from table name
2. Select some records that meet the conditions in the table.
Select from table name where column name = 'column name'
3. Select some attributes of all records in the table
Select column name from table name
The role of the Where statement determines which records are manipulated
It mainly affects the three operations of update select delete.
Sort out the query results
Aggregate function pre-written blocks of code for frequently used functions / methods
Backup database (export): mysqldump-u user name-p password database name > backup file name. Sql
Database recovery (import): mysql backup file name. sql < database name
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.