兴国资源网 Design By www.nnzcdc.com
在日常的网站维护和管理中,会用到非常多的SQL语句,
熟练使用对网站管理有很多好处,尤其是站群管理的时候。
下面列一些常用的命令做备记。
1、显示数据库
show databases
显示表
show tables;
2、创建用户
创建root用户密码为123
use mysql; grant all on *.* to root@'%' identified by '123' with grant option; commit;
3、修改密码
grant all on *.* to xing@'localhost' identified by '123456' with grant option; update user set password = password('newpwd') where user = 'xing' and host='localhost'; flush privileges;
4、创建数据库testdb:
create database testdb;
5、预防性创建数据库:
create database if not testdb;
6、创建表:
use testdb; create table table1( username varchar(12), password varchar(20));
7、预防性创建表aaa:
create table if not exists aaa(ss varchar(20));
8、查看表结构:
describe table1;
9、插入数据到表table1:
insert into table1(username,password) values ('leizhimin','lavasoft'), ('hellokitty','hahhahah'); commit;
10、查询表table1:
select * from table1;
11、更改数据:
update table1 set password='hehe' where username='hellokitty'; commit;
12、删除数据:
delete from table1 where username='hellokitty'; commit;
13、给表添加一列:
alter table table1 add column( sex varchar(2) comment '性别', age date not null comment '年龄' ); commit;
14、修改表结构
从查询创建一个表table1:
create table tmp as select * from table1;
15、删除表table1:
drop table if exists table1; drop table if exists tmp;
16、备份数据库testdb
mysqldump -h 192.168.3.143 -u root -p pwd -x --default-character-set=gbk >C:\testdb.sql
17、删除数据库testdb
drop database testdb;
18、恢复testdb数据库
首先先建立testdb数据库,然后用下面命令进行本地恢复
mysql -u root -pleizhimin testdb <C:\testdb.sql
这18个MYSQL命令都是管理员在日常维护中经常会用到的,熟练使用这些命令会使你的工作非常轻松
兴国资源网 Design By www.nnzcdc.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
兴国资源网 Design By www.nnzcdc.com
暂无评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
2024年10月05日
2024年10月05日
- 群星《前途海量 电影原声专辑》[FLAC/分轨][227.78MB]
- 张信哲.1992-知道新曲与精丫巨石】【WAV+CUE】
- 王翠玲.1995-ANGEL【新艺宝】【WAV+CUE】
- 景冈山.1996-我的眼里只有你【大地唱片】【WAV+CUE】
- 群星《八戒 电影原声带》[320K/MP3][188.97MB]
- 群星《我的阿勒泰 影视原声带》[320K/MP3][139.47MB]
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[320K/MP3][148.91MB]
- 刘雅丽.2001-丽花皇后·EMI精选王【EMI百代】【FLAC分轨】
- 齐秦.1994-黄金十年1981-1990CHINA.TOUR.LIVE精丫上华】【WAV+CUE】
- 群星.2008-本色·百代音乐人创作专辑【EMI百代】【WAV+CUE】
- 群星.2001-同步过冬AVCD【环球】【WAV+CUE】
- 群星.2020-同步过冬2020冀待晴空【环球】【WAV+CUE】
- 沈雁.1986-四季(2012梦田复刻版)【白云唱片】【WAV+CUE】
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[FLAC/分轨][257.88MB]
- 《国语老歌 怀旧篇 3CD》[WAV/分轨][1.6GB]