当前位置:网站首页>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 .
边栏推荐
- CSDN insertion directory in 1 second
- np.where 和 torch.where 用法
- Laravel artisan common commands
- 1218 square or round
- * and & symbols in C language
- 大学的知识是否学而无用、过时?
- How to use a product to promote "brand thrill"?
- Ar Augmented Reality applicable scenarios
- AR增强现实可应用的场景
- [Video] visual interpretation of Markov chain principle and Mrs example of R language region conversion | data sharing
猜你喜欢

734. Energy stone (greed, backpack)

【毕业季】研究生学长分享怎样让本科更有意义

mysql列转行函数指的是什么

跨域?同源?一次搞懂什么是跨域

If you want to rewind the video picture, what simple methods can you use?

【OpenCV】-5种图像滤波的综合示例

Redis有序集合如何使用

【LeetCode 43】236. The nearest common ancestor of binary tree

Types of exhibition items available in the multimedia interactive exhibition hall

Design and implementation of key value storage engine based on LSM tree
随机推荐
Experimental reproduction of variable image compression with a scale hyperprior
Laravel artisan common commands
Exception handling of class C in yyds dry goods inventory
软件开发生命周期 --瀑布模型
New news, Wuhan Yangluo international port, filled with black technology, refreshes your understanding of the port
Number of palindromes in C language (leetcode)
This is the form of the K-line diagram (pithy formula)
2022 Q2 - résumé des compétences pour améliorer les compétences
[技术发展-21]:网络与通信技术的应用与发展快速概览-1- 互联网网络技术
leetcode2312. Selling wood blocks (difficult, weekly race)
* and & symbols in C language
The middle element and the rightmost element of the shutter
JMeter (I) - download, installation and plug-in management
Learn basic K-line diagram knowledge in three minutes
np.where 和 torch.where 用法
CSDN insertion directory in 1 second
How to solve MySQL master-slave delay problem
C language 3-7 daffodils (enhanced version)
734. Energy stone (greed, backpack)
Construction and maintenance of business websites [13]