当前位置:网站首页>Basic operations of MAC MySQL database
Basic operations of MAC MySQL database
2022-06-29 09:33:00 【Novice little white petal God】
1、 start-up 、 restart 、 stop it 、 see MySQL state
sudo /usr/local/mysql/support-files/mysql.server start
sudo /usr/local/mysql/support-files/mysql.server stop
sudo /usr/local/mysql/support-files/mysql.server restart
sudo /usr/local/mysql/support-files/mysql.server status
2、 Reset password
Not for a long time , It's common to forget your password ... The password needs to be reset .
mysql -u root -p
3. Access to database
/usr/local/MySQL/bin/mysql -u root -p
4. Query the database
show databases;
Two 、 Connect to the remote database and enter the command line :
Suppose the remote host's IP by :ip Address , The user is called root, The password for 123456
1、 Open the terminal , Enter the following command :
mysql -h ip Address -u root -p 123456
2、 Input password :
Interface prompts for password :
Enter password:
If the database is used for the first time , The default password is blank , Enter directly mysql Command line ;
If password is set , Then enter the password , enter , You can enter mysql Command line .
3、 ... and 、 Exit command :exit, Press enter again to exit mysql Command line .
Four :
1、 Create a name for NickYang database create database NickYang character set utf8;
2、 Modify database code :alter database NickYang character set utf8;
3、 Check whether the database is created successfully :show databases;
4、 Access to database :use NickYang;
5、 Create a table and assign a primary key to it :create table yang(id int primary key);
6、 See if the table was created successfully :show tables;
7、 View table structure :desc Table name ;
8、 Add fields :alter table Table name add Field name data type [ Location ];
alter table yang add name varchar(255) after id;
9、 Delete field :alter table Table name drop Field name ;
alter table yang drop name;
10、 The new data :insert into Table name ( Field name ) values( value )
insert into yang(id,name) values(1,'name');
11、 Delete data :delete from Table name [where Conditions ];
delete from yang [where id = 1]
12、 Modifying data :update Table name set Field = value [where Conditions ]
update yang set name = 'yang' where id = 1;
13、 Find data :select * from Table name [where Conditions ];
select * from yang [where id = 1];
边栏推荐
- YOLO Nano:一种高度紧凑的只看一次的卷积神经网络用于目标检测
- The difference between cokkie and session
- Pytorch learning summary - memory cost of operation
- Uber 前安全主管面临欺诈指控,曾隐瞒数据泄露事件
- The principle of session and cookie
- Wechat applet sub components transfer values to the page (communication between parent and child components) with source code
- GD32F4xx 以太網芯片(enc28j60)驅動移植
- Wechat applet opens file stream
- Wechat applet sharing page, sharing to the circle of friends
- Gd32f4xx Ethernet chip (ENC28J60) driver migration
猜你喜欢

UE4 编译单个文件(VS与编辑器分别启动)

LFFD:一种用于边缘检测的轻量化快速人脸检测器

Open3d farthest point sampling (FPS)

超融合架构和传统架构有什么区别?

SSD Improvement cfenet

Yolo nano: a highly compact one look convolutional neural network for target detection

In the era of data processing, data quality construction is the way for enterprises to survive

train_ on_ Batch save the image of the loss function change

GD32F4xx 以太网芯片(enc28j60)驱动移植

Find the most repeated element in the string
随机推荐
Wechat applet jump to official account image and text content
Five heart charity matchmaker team
Augfpn: amélioration de l'apprentissage des caractéristiques à plusieurs échelles pour la détection des cibles
UE4 blueprint modify get a copy in array to reference
UE4 在4.20-23版本安裝Datasmith插件
数据处理时代,数据质量建设才是企业的生存之道
Wechat applet latest canvas2d handwritten signature
【数据集】|标注的bbox影响 Can we trust bounding box annotations for object detection
Simplicity Studio无法识别新买的JLink v9解决方法
SSD Improvement cfenet
SSD改進CFENet
数据仓库:金融/银行业的分层架构篇
Open3d hidden point removal
Reading notes on how to connect the network - Web server request and response (IV)
Detailed version of two-stage target detection principle
Wechat applet project: wechat applet page layout
Yotact real-time instance segmentation
pytorch总结—TENSOR ON GPU
SSD improvements cfenet
UE4 编译单个文件(VS与编辑器分别启动)