Mysql显示无服务
在mysql的bin目录下 输入命令 mysqld --install
出现service successfully install 就代表安装成功
配置环境变量
1.把mysql的bin文件路径放 添加到电脑上的环境变量内
这个时候你输入 命令net start mysql ,服务依旧无法启动。
原因可能是在mysql的目录下没有存放数据的data文件,所以就需要创建data文件夹。
使用命令 mysqld --initialize-insecure就可以生成data文件夹
重新 输入 net start mysql 开启数据库
mySQL的基础语法
查 select
select * from 表名 where id=5 //查询表中id为5的 一行数据
select * from 表名 where name like “yang_”;//查询name以yang开头且余一位的 的所有行 数据
select * from 表名 where name like “yang%”;//查询name以yang开头的所有行 数据
select * from 表名 where 1 limit 1,2 ;//从1开始 截取两条
select name,score from 表名 where 1;查询 表中所有的 name score
添加
insert into 表名(a,b,c)
values (值a,值b,值c)//值要与abc一一对应
改
update user set name=“yang” where id=1 //修改id为1的行 的name 为 “yang”
删
DELETE from user where id=5 //删除id为5的行