当前位置:网站首页>MySQL operates the database through the CMD command line, and the image cannot be found during the real machine debugging of fluent
MySQL operates the database through the CMD command line, and the image cannot be found during the real machine debugging of fluent
2022-07-02 02:09:00 【wqwq_ twenty-two】
Run as administrator cmd Command line → Input net start mysql → enter
Stop the service and use the command :net stop mysql
3、 ... and 、 Connect MYSQL
=========
Format :
mysql -h The host address -u user name -p User password
-h The host address can be omitted
Example :
Suppose the user name is root The password for 123456
mysql -hlocalhost -uroot -p123456
mysql -uroot -p123456
sign out MYSQL command : exit ( enter )
Four 、 Change user name and password
=========
Format :
mysqladmin -u user name -p Old password password New password
Example :
to root The user sets the password as 123456
mysqladmin -u root -password 123456
then root The user password is changed to 123123
mysqladmin -u root -p 123456 password 123123
Command line modification root password :
mysql> UPDATE mysql.user SET password=PASSWORD(‘ New password ’) WHERE User=‘root’;
mysql> FLUSH PRIVILEGES;
5、 ... and 、 Common operation commands of database
===========
1、 Show database list :
mysql> SHOW DATABASES;
2、 Building a database :
mysql> CREATE DATABASE Library name ;
3、 Delete database :
mysql> DROP DATABASE Library name ;
4、 Create data tables :
mysql> CREATE TABLE Table name ( Field name VARCHAR(20), Field name CHAR(1));
5、 Modify the field name and properties
mysql> alter table Table name change Field name new field name varchar(50);
6、 Fields inserted into the table
mysql> alter table Table name add newColumn varchar(8) NOT NULL COMMENT ‘ Newly added fields ’;
7、 Delete data table :
mysql> DROP TABLE Table name ;
8、 Empty the records in the table :
mysql> DELETE FROM Table name ;
9、 Modify the name of the table :
mysql> alter table t1 rename t2
10、 Query table data :
mysql> select * from Table name ;
11、 Insert a record into a table :
mysql> INSERT INTO Table name VALUES (“ Zhang San ”,“20”);
10、 Update the data in the table :
mysql> UPDATE Table name SET Field name 1=‘a’, Field name 2=‘b’ WHERE Field name 3=‘c’;
11、 Load data into a data table in text form :
mysql> LOAD DATA LOCAL INFILE “D:/mysql.txt” INTO TABLE Table name ;
12、 Import .sql File command :
mysql> USE Database name ;
mysql> SOURCE d:/mysql.sql;
6、 ... and 、 Sample code
======
1、 Create database
drop database if exists mydata; // If there is mydata Delete
create database mydata; // Create a mydata The database of
use mydata; // Open database mydata
2、 Create data table
grammar :
CREATE TABLE table_name(col_name col_type col_attr, col_name col_type col_attr,……)
Parameters :
A data table , Composed of multiple columns , Multiple column definitions are separated by commas in English .
col_name: Column name .
col_type: The type of the column . Such as :tinyint、int、bigint、char、varchar、text、date、time etc. .
col_attr: Column properties .
NOT NULL | NULL: Whether the column can be empty .
DEFAULT default_value: Refers to the default value of this column ,default_value The default value can be a string , It can also be integer .
AUTO_INCREMENT: This column is auto growth , Or automatic numbering . The column must be integer . A table can only have one auto_increment attribute .
PRIMARY KEY: Primary key , Specifies that the value of this column is unique , The column where the primary key is located cannot be empty . The primary key of a table can only have one .
id The properties of the field must have :NOT NULL AUTO_INCREMENT PRIMARY KEY, In this way, the serial number can increase itself .
Example :
create table user
(
id int(11) auto_increment not null primary key,
name varchar(20) not null COMMENT ‘ name ’,
age int(3) not null default 0 COMMENT ‘ Age ’,
address varchar(50) default ‘ Shenzhen ’ COMMENT ‘ Address ’,
year date
);
3、 Insert data into table
insert into user values(‘ Zhang San ’,18,‘ Shenzhen ’,‘2021-10-10’);
insert into user values(‘ Li Si ’,20,‘ Guangzhou ’,‘2021-10-15’);
7、 ... and 、 Backup database
=======
1、 Export the entire database ( The export file exists by default mysql\bin Under the table of contents )
Last
Actually Android There are so many knowledge points in development , There are still so many things to ask about in the interview . So there's no other trick to an interview , It depends on how well you are prepared for these knowledge points .so, When you go out for an interview, you should first see which stage you have reviewed .
although Android It's not as hot as it was a few years ago , It's past the era when you can find high paying jobs with four components . It just means Android The posts below the intermediate level are saturated , At present, there is still a lack of senior engineers , A lot of senior positions pay really high salaries ( A lot of money doesn't necessarily mean you can find the right one ), So it's important to try to be a senior engineer .
Attached here are dozens of sets of bytes related to the above interview questions , JD.COM , millet , tencent 、 headlines 、 Ali 、 Meituan and other companies 21 Interview questions for . Put the technical points into video and PDF( In fact, it took a lot more energy than expected ), Contains the context of knowledge + A lot of details .
Due to limited space , Here's a small part of it in the form of pictures .
Detailed arrangement in GitHub You can see ;
Android Architecture video +BAT Interview topics PDF+ Learning notes
Online learning Android A lot of information , But if the knowledge learned is not systematic , When you encounter a problem, you just have a taste of it , No further study , So it's hard to really improve the technology . I hope this systematic technical system has a direction reference for you .
Detailed arrangement in GitHub You can see ;
Android Architecture video +BAT Interview topics PDF+ Learning notes
Online learning Android A lot of information , But if the knowledge learned is not systematic , When you encounter a problem, you just have a taste of it , No further study , So it's hard to really improve the technology . I hope this systematic technical system has a direction reference for you .
边栏推荐
- JPM 2021 most popular paper released (with download)
- mysql列转行函数指的是什么
- leetcode2305. Fair distribution of biscuits (medium, weekly, shaped pressure DP)
- 【LeetCode 43】236. The nearest common ancestor of binary tree
- Pytest testing framework
- Ubuntu20.04 PostgreSQL 14 installation configuration record
- Construction and maintenance of business websites [12]
- The concept, function, characteristics, creation and deletion of MySQL constraints
- 2022 Q2 - 提昇技能的技巧總結
- A quick understanding of digital electricity
猜你喜欢
leetcode2305. 公平分发饼干(中等,周赛,状压dp)
With the innovation and upgrading of development tools, Kunpeng promotes the "bamboo forest" growth of the computing industry
leetcode2311. 小于等于 K 的最长二进制子序列(中等,周赛)
Architecture evolution from MVC to DDD
JPM 2021 most popular paper released (with download)
Number of palindromes in C language (leetcode)
This is the form of the K-line diagram (pithy formula)
734. Energy stone (greed, backpack)
mysql列转行函数指的是什么
A quick understanding of analog electricity
随机推荐
Golang lock
[technology development -21]: rapid overview of the application and development of network and communication technology -1- Internet Network Technology
How to use a product to promote "brand thrill"?
花一个星期时间呕心沥血整理出高频软件测试/自动化测试面试题和答案
A quick understanding of digital electricity
【视频】马尔可夫链蒙特卡罗方法MCMC原理与R语言实现|数据分享
正则表达式学习笔记
STM32F103——两路PWM控制电机
leetcode2310. 个位数字为 K 的整数之和(中等,周赛)
Niuke - Huawei question bank (51~60)
Volume compression, decompression
Exception handling of class C in yyds dry goods inventory
Construction and maintenance of business websites [10]
734. Energy stone (greed, backpack)
This is the form of the K-line diagram (pithy formula)
Design and implementation of key value storage engine based on LSM tree
Open that kind of construction document
leetcode2309. The best English letters with both upper and lower case (simple, weekly)
flutter 中間一個元素,最右邊一個元素
剑指 Offer 29. 顺时针打印矩阵