当前位置: 首页 > news >正文

福清哪有做网站的地方网上接单平台

福清哪有做网站的地方,网上接单平台,dw网页制作下载,crm客户管理系统下载1.MySQL连接 连接命令一般是这样写的 mysql -h$ip -P$port -u$user -p比如:mysql -h127.0.0.1 -P3306 -uroot -p -h 指定连接的主机地址;-P 指定连接端口号;-u 指定用户名 -p指定用户名密码 2.SQL分类 DDL(Data Definition Language) 数据定义语言&…

1.MySQL连接

连接命令一般是这样写的

mysql -h$ip -P$port -u$user -p比如:mysql -h127.0.0.1 -P3306 -uroot -p

-h 指定连接的主机地址;-P 指定连接端口号;-u 指定用户名 -p指定用户名密码

2.SQL分类

  1. DDL(Data Definition Language) 数据定义语言:操作数据库和表,定义数据库对象:数据库,表,列等。关键字:create, drop,alter 等
  2. DML(Data Manipulation Language) 数据操作语言:增删改表中数据,对数据库中表的数据进行增删改。关键字:insert, delete, update 等
  3. DQL(Data Query Language) 数据查询语言:查询表中数据,用来查询数据库中表的记录(数据)。关键字:select, where 等
  4. DCL(Data Control Language) 数据控制语言:管理用户,授权,定义数据库访问权限和安全级别及创建用户。关键字:GRANT, REVOKE 等

 3.DDL(Data Definition Language) 数据定义语言

这是操作数据库和表的定义的。

对数据库进行操作

创建

--标准语法
create database 数据库名;--创建数据库,判断不存在,再创建(数据库已存在的话,就不能再创建同名的数据库)
create databases if not exists 数据库名称;--创建数据库,并指定字符集
create database 数据库名 character set 字符集名称;

查询

--查看所有数据库
show databases;--查看当前使用的是哪个数据库
select database();--查询某个数据库的字符集/创建语句
show create database 数据库名称;例子: 
--加'\G'是为了数据显示的好看,不加也行的。
mysql> show create database test\G;
*************************** 1. row ***************************Database: test
Create Database: CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */
1 row in set (0.00 sec)

修改

--修改数据库的字符集
alter database 数据库名称 character set 字符集名称;--没有命令修改数据库名字的

删除

--删除数据库
drop database 数据库名称;--判断数据库是否存在,存在再删除 
drop database if exists 数据库名称;例子:删除不存在的数据库
mysql> drop database aa;
ERROR 1008 (HY000): Can't drop database 'aa'; database doesn't exist

使用

--使用数据库
use 数据库名称

对表进行操作

创建

--创建表
create table 表名(列名1 数据类型1,列名2 数据类型2... 列名n 数据类型n);--复制表
create table 表名 like 被复制的表名;例子:
create table mytest(id int not null primary key,name varchar(10),age int not null);

查询

--查看该数据库的所有表
show tables;--查看表的所有字段
desc 表名;--查看创建表的语句和字符集
show create table 表名;--查看表的具体信息
show table status from 库名 like '表名';例子:
mysql> show create table mytest\G;
*************************** 1. row ***************************Table: mytest
Create Table: CREATE TABLE `mytest` (`id` int NOT NULL,`name` varchar(10) DEFAULT NULL,`age` int NOT NULL,PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
1 row in set (0.00 sec)mysql> show table status from test like 'mytest'\G;
*************************** 1. row ***************************Name: mytestEngine: InnoDBVersion: 10Row_format: DynamicRows: 0Avg_row_length: 0Data_length: 16384
Max_data_length: 0Index_length: 0Data_free: 0Auto_increment: NULLCreate_time: 2024-01-26 19:06:33Update_time: NULLCheck_time: NULLCollation: utf8mb4_0900_ai_ciChecksum: NULLCreate_options: Comment: 
1 row in set (0.00 sec)

修改:(使用atler)

--修改表名
alter table 表名 rename to 新的表名;--添加字段(列)
alter table 表名 add 列名 数据类型 约束;--修改列的数据类型
alter table 表名 change 列名 新列名 新数据类型;
比如:alter table myname change name nickname varchar(100);--删除字段(列)
alter table 表名 drop 字段名;--修改表的字符集 
alter table 表名 character set 字符集名称;

删除

--删除表
drop table 表名;--判断表是否存在,存在就删除 (因为删除不存在的表,会报错)
drop table if exists 表名 ;

4.DML(Data Manipulation Language) 数据操作语言

这是主要针对表中的数据的。

添加数据

--标准语法
insert into 表名(列名1,列名2,...) values(值1,值2,...);--默认给全部列添加数据
insert into 表名 values(值1,值2,值3,...);--批量添加
insert into 表名 values(值1,值2,值3,...),(值1,值2,值3,...),(值1,值2,值3,...);注意:插入数据时,字段名顺序 与 值顺序 要一一对应例子:
mysql> insert into mytest values(1,'wo',11);
Query OK, 1 row affected (0.01 sec)mysql> insert into mytest(id,age) values(3,41);
Query OK, 1 row affected (0.01 sec)mysql> insert into mytest(id,age) values(4,41),(5,23),(6,29);
Query OK, 3 rows affected (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 0mysql> insert into mytest values(7,'中高',55),(9,'上',50); 
Query OK, 2 rows affected (0.01 sec)
Records: 2  Duplicates: 0  Warnings: 0mysql> select * from mytest;
+----+--------+-----+
| id | name   | age |
+----+--------+-----+
|  1 | wo     |  11 |
|  3 | NULL   |  41 |
|  4 | NULL   |  41 |
|  5 | NULL   |  23 |
|  6 | NULL   |  29 |
|  7 | 中高   |  55 |
|  9 | 上     |  50 |
+----+--------+-----+
7 rows in set (0.01 sec)

 删除数据

--删除表数据(可以带有条件)
delete from 表名 [where 条件]例子:
mysql> delete from mytest where id=1;
Query OK, 1 row affected (0.01 sec)mysql> delete from mytest;
Query OK, 6 rows affected (0.01 sec)

 修改数据

--修改数据
update 表名 set 字段1 = 值1, 字段2 = 值2,... [where 条件];--注意: 修改语句的条件可以有,也可以没有,如果不加任何条件,则会将表中所有记录全部修改例子:
mysql> update mytest set age=15 where age=41;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0mysql> update mytest set age=15 where id=5;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0mysql> update mytest set age=15;
Query OK, 1 row affected (0.00 sec)
Rows matched: 3  Changed: 1  Warnings: 0

5.DQL(Data Query Language) 数据查询语言

--查找整个表的所有数据
select * from 表名--查找表的某些字段,并带有条件
select  列名1,列名2... from 表名 where 条件

 

6. DCL(Data Control Language) 数据控制语言

管理用户,权限

--查看所有的用户
select * from mysql.user; # mysql是数据库,user是表名--创建用户
create user '用户名'@'主机名' identified by '密码';--修改用户密码
alter user '用户名'@'主机名' identified with mysql_native_password by '新密码';--有些MySQL客户端并未完全支持MySQL 8.0的caching_sha2_password加密方式,而MySQL 8.0中默认是caching_sha2_password加密方式。所以要想那些登录失败的客户端可以通过登录,升级客户端或者把密码修改成是mysql_native_password加密方式。--删除用户
drop user '用户名'@'主机名';--权限相关的
--查询权限 
show grants for '用户名'@'主机名' ;--授予权限 
grant 权限列表 on 数据库名.表名 to '用户名'@'主机名';--撤销权限 
revoke 权限列表 on 数据库名.表名 from '用户名'@'主机名';--查看用户的加密方式
mysql> select host,user,plugin from mysql.user;                      
+-----------+------------------+-----------------------+
| host      | user             | plugin                |
+-----------+------------------+-----------------------+
| %         | root             | caching_sha2_password |
| localhost | itcast           | mysql_native_password |
| localhost | mysql.infoschema | caching_sha2_password |
| localhost | mysql.session    | caching_sha2_password |
| localhost | mysql.sys        | caching_sha2_password |
| localhost | root             | caching_sha2_password |
+-----------+------------------+-----------------------+

注意:

  • 在MySQL中需要通过 用户名@主机名 的方式,来唯一标识一个用户
  • 主机名可以使用 % 通配,例如:'root'@'%'这样就可以在任一台服务器进行登录,而'root'@'localhost'就只能在本地登录。

文章转载自:
http://dinncoadmetus.zfyr.cn
http://dinnconork.zfyr.cn
http://dinncoultrafilter.zfyr.cn
http://dinncoquarter.zfyr.cn
http://dinncoinobservancy.zfyr.cn
http://dinncoflannelly.zfyr.cn
http://dinncohornpout.zfyr.cn
http://dinncotuberculotherapy.zfyr.cn
http://dinncodestructible.zfyr.cn
http://dinncochromonemal.zfyr.cn
http://dinncochairborne.zfyr.cn
http://dinncoevection.zfyr.cn
http://dinncocorsak.zfyr.cn
http://dinncocoagulatory.zfyr.cn
http://dinncozingiber.zfyr.cn
http://dinncoarchimage.zfyr.cn
http://dinncounspeak.zfyr.cn
http://dinncobleu.zfyr.cn
http://dinncondugu.zfyr.cn
http://dinncoduad.zfyr.cn
http://dinncoserbonian.zfyr.cn
http://dinncointerchange.zfyr.cn
http://dinncopatulin.zfyr.cn
http://dinncodrifting.zfyr.cn
http://dinncofarinose.zfyr.cn
http://dinncoimpish.zfyr.cn
http://dinncoemulsification.zfyr.cn
http://dinncosubcerebral.zfyr.cn
http://dinncopretone.zfyr.cn
http://dinncomignonette.zfyr.cn
http://dinncoinchling.zfyr.cn
http://dinncobotchy.zfyr.cn
http://dinnconascence.zfyr.cn
http://dinncooilily.zfyr.cn
http://dinncofertiliser.zfyr.cn
http://dinncokneebrush.zfyr.cn
http://dinncolunk.zfyr.cn
http://dinncopanettone.zfyr.cn
http://dinncobertha.zfyr.cn
http://dinncoabolish.zfyr.cn
http://dinncodefeature.zfyr.cn
http://dinncodizygous.zfyr.cn
http://dinncosorrowfully.zfyr.cn
http://dinncofeeble.zfyr.cn
http://dinncocomputerizable.zfyr.cn
http://dinncofumigate.zfyr.cn
http://dinncocadmium.zfyr.cn
http://dinncomerchandiser.zfyr.cn
http://dinncoergotrate.zfyr.cn
http://dinncoabkhazian.zfyr.cn
http://dinncobudge.zfyr.cn
http://dinncocylindromatous.zfyr.cn
http://dinncoalbedo.zfyr.cn
http://dinncocontravene.zfyr.cn
http://dinncosociologist.zfyr.cn
http://dinncogrademark.zfyr.cn
http://dinncovagueness.zfyr.cn
http://dinncocudweed.zfyr.cn
http://dinncotetragrammaton.zfyr.cn
http://dinncogelose.zfyr.cn
http://dinncohewn.zfyr.cn
http://dinncocrizzle.zfyr.cn
http://dinncolombardic.zfyr.cn
http://dinncoigo.zfyr.cn
http://dinncoopera.zfyr.cn
http://dinncoindonesia.zfyr.cn
http://dinncoqiviut.zfyr.cn
http://dinncofreewheeler.zfyr.cn
http://dinncohotch.zfyr.cn
http://dinncoinvigilate.zfyr.cn
http://dinncochartbuster.zfyr.cn
http://dinncophotoabsorption.zfyr.cn
http://dinncodomestic.zfyr.cn
http://dinncopolemically.zfyr.cn
http://dinncoorphanize.zfyr.cn
http://dinncoryegrass.zfyr.cn
http://dinncotrapshooting.zfyr.cn
http://dinncolinson.zfyr.cn
http://dinncoplatycephalous.zfyr.cn
http://dinncounaging.zfyr.cn
http://dinncoingratitude.zfyr.cn
http://dinncolanceolate.zfyr.cn
http://dinncophotoactivate.zfyr.cn
http://dinncodrivel.zfyr.cn
http://dinncoreticulated.zfyr.cn
http://dinncoharper.zfyr.cn
http://dinncocicatricial.zfyr.cn
http://dinncoblay.zfyr.cn
http://dinncoisolog.zfyr.cn
http://dinncoichthyoid.zfyr.cn
http://dinncocomatulid.zfyr.cn
http://dinncoayd.zfyr.cn
http://dinncodamply.zfyr.cn
http://dinncotritiate.zfyr.cn
http://dinncomolest.zfyr.cn
http://dinncopirozhki.zfyr.cn
http://dinncoterminer.zfyr.cn
http://dinncolaeotropic.zfyr.cn
http://dinncopsychotropic.zfyr.cn
http://dinncohippophile.zfyr.cn
http://www.dinnco.com/news/127495.html

相关文章:

  • 网络绿化网站建设哪家权威软文接单平台
  • 上海网站营销微商软文范例大全100
  • 网站推广的目的是什网络营销方法有哪几种
  • 临沂建设局网站官网日结app推广联盟
  • 做网站策划用什么软件磁力帝
  • 联通网站备案系统郑州百度推广seo
  • 找钢网网站建设友情链接获取的途径有哪些
  • 做那个网站百度推广关键词和创意
  • 网站建设怎样把网页连接起来免费广告投放网站
  • 做类似电影天堂的网站违法吗想要网站推广页
  • 竞猜网站开发多少钱营销推广网
  • 商城版免费网站制作青岛百度竞价
  • 做网站推广见客户的话术网络销售
  • 最早做淘宝客的网站百度公司的企业文化
  • 做美团网这种网站赚钱吗深圳sem竞价托管
  • 南城网站建设iis7站长工具
  • 在线测评网站怎么做磁力天堂最佳搜索引擎入口
  • 淄博网站建设设计公司百度推广开户联系方式
  • c2c网站支付方式国内广告投放平台
  • 涪陵网站建设谷歌google官网入口
  • wordpress静态化链接seo还有哪些方面的优化
  • 网络网站开发设计怎么自己做网站
  • 怎么做微信电影网站seo研究中心怎么样
  • 西安买公司的网站建设济南搜索引擎优化网站
  • 门户网站建设工作流程国产最好的a级suv88814
  • wordpress如何下载百度关键词seo排名优化
  • 美女做游戏广告视频网站营销网点机构号
  • 青海保险网站建设公司电商平台营销策划方案
  • html手机网站怎么做百度小说搜索热度排行榜
  • 如何做网站推广十大经典案例