exit退出
mysql(登录mysql) -u root(用root用户登) -p(密码)
输入password(输入不了就是没有配置环境变量)
navicat(数据库可视化管理工具)
报错2059(因为navicat是12 mysql是8 重置密码就可):
1.进入doc: 点击Window+R 输入cmd
2.登陆数据库:输入mysql -uroot -p
3.输入你的数据库密码,正确后显示登陆成功 出现Welcome to the MySQL monitor.
4.输入 use mysql; 出现Database changed
5.输入select user,host from user; 目的为了查看user的root 对应host是什么 我的对应为localhost
6.修改加密规则:输入ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码';
数据库建库语句
Create Database 数据库名称;
查看当前所有数据库
show databases;
删除数据库
drop database 数据库名称;
使用指定数据库
use 数据库名;
客户信息表 wx_customer_information
编号 id
名字 name
性别 gender
年龄 age
婚姻 married
电话 phonenum
收入 income
职业 career
建表语句
create table wx_customer_information(
id int(10),
name varchar(20),
age int(3),
phonenum int(11),
married int(1),
career varchar(10),
income double
);
查看表
show create table 表名;(查看建表语句以及编码格式)
desc 表名;(查看表结构)BCBBCCB
以后有课的话应该会在上面更新,不过没课的话就随缘好了,在次祈祷老蒋不要发现我,我很慌,上课在摸鱼