mysql
进入到我的数据库 进行更改密码
我的数据库地址
D:\Develop\mysql\bin\mysqld MySQL
-
建立数据库
create database myBlog
-
使用数据库
use myBlog
-
创建表名
必须要有一个主键
create table user(id int not null auto_increment primary key ,
username varchar(100) not null,
password varchar(100) not null);
-
删除库名
DROP DATABASE 库名;
-
将表中记录清空
DELETE FROM 表名;
- 往表中插入数据
insert into user values (null, ‘247959360’, ‘12133’);
不填的为空 其他的键值互相对应就可以了
意思就是往states这个表中插入一下关键字
- 查看表的结构
select * from user
查询这张表 的数据 这就是查看具体某张表
-
查看有几张表
show tables
-
查看有哪些数据库
show databases;
-
删除某条数据
delete from user where id = '1';
-
删除多条数据
delete from user where id in (2,4) 有包含 2和4 首尾都包括了
注意 命令结尾 加上分号
个人博客加上 音乐功能 进行边看文章 边听音乐的效果 谨记
https://blog.csdn.net/lx_1024/article/details/78815173 vue实现登录注册功能
login() {
if (this.username == "" || this.password == "") {
this.tips = "请输入用户名或者密码"
this.showTips = true
} else {
let data = {
'username': this.username,
'passsword': this.password
}
this.$axios.post('/api/login', data).then((res) => {
if (res.data == -1) {
this.tips = "该用户不存在"
this.showTips = true
} else if (res.data == 0) {
this.tips = "密码输入错误"
this.showtips = true
}
esle
if (res.data == 1) {
this.tips = "登录成功"
this.showTips = true
setCookie('username', this.username, 1000 * 60)
setTimeout(function() {
this.$router.push('/home')
}.bind(this), 1000)
} else {
console.log('请重新输入')
}
})
}
}