mysql

MySQL基础语句

懵懂的女人 提交于 2021-02-08 23:03:25
------------------------------------------------ mysql启动不了使用: 1. 先把启动程序kill了 mysqld 2. 重启mysql服务 service mysql restart ------------------------------------------------- 用户相关操作 注:以下命令均需先以root身份登录mysql:mysql -uroot -p 1.添加新用户 (1)创建新用户:> insert into mysql.user(Host,User,Password)     values("localhost","user1",password("password1")); (2)为用户分配权限: 设置用户可以在本地访问mysql:grant all privileges on *.* to username@localhost identified by "password" ; 设置用户只能访问指定数据库:grant all privileges on 数据库名.* to username@localhost identified by "password" ; (3)刷新系统权限表:>flush privileges; 2.查看MySql当前所有的用户:>SELECT DISTINCT

MySQL基础语句

僤鯓⒐⒋嵵緔 提交于 2021-02-08 21:05:10
###查看语句 查看所有数据库 show databases; 查看表结构 desc table_name; 查看库中所有表 show tables; 查看建表语句 show create table <table_name> ; ###新建表语句 新建表: id int unsigned not null auto_increment comment '用户id', uesr_name varchar(20) not null comment '用户名', email varchar(50) not null comment '用户邮箱', age tinyint unsigned not null comment '用户年龄', fee decimal(10,2) not null default 0.00 comment '用户余额', created_at timestamp not null comment '注册时间', primary key(id) ); Filed Type Null Key Default Extra id int(10) NO PRI NUll auto_increment uesr_name varchar(20) NO NUll email varchar(50) NO NUll age tinyint NO NUll fee

Understanding cartesian product in SQL

 ̄綄美尐妖づ 提交于 2021-02-08 20:59:13
问题 I am not able to understand how Cartesian product works. Consider the simple schema: mysql> select * from account; +----------------+-------------+---------+ | account_number | branch_name | balance | +----------------+-------------+---------+ | A101 | Downtown | 500 | | A102 | Perryridge | 400 | | A201 | Brighton | 900 | | A215 | Mianus | 700 | | A217 | Brighton | 750 | | A222 | Redwood | 700 | | A305 | Round Hill | 350 | +----------------+-------------+---------+ 7 rows in set (0.00 sec)

Is it possible to query a database using a value passed in a URL, and write the result of the query to the URL using mod_rewrite?

限于喜欢 提交于 2021-02-08 20:56:11
问题 Is it possible to use mod_rewrite to write an htaccess rule that takes a url parameter value (for example: id=1, where 'id' is the parameter, and '1' is the parameter value), query a database with the parameter value specified, and then write the value returned from the query as a part of the url of the requested page? I know the basics of mod_rewrite, for example rewriting a url that appears like: www.example.com/item.php?id=1 to the following: www.example.com/item/1 An example of what I

Caused by: java.time.DateTimeException: Conflict found: Field DayOfWeek 6 differs from DayOfWeek 2 derived from 2016-01-30

只谈情不闲聊 提交于 2021-02-08 19:46:37
问题 I am parsing dates like this: "Sat, 30 Jan 2016 00:03:00 +0300" But in some of the dates it throw me this exception: Caused by: java.time.DateTimeException: Conflict found: Field DayOfWeek 6 differs from DayOfWeek 2 derived from 2016-01-30 or this: java.time.format.DateTimeParseException: Text 'Tue, 30 Jan 2016 00:06:00 +0300' could not be parsed: Conflict found: Field DayOfWeek 6 differs from DayOfWeek 2 derived from 2016-01-30 Here is some of my code: DateTimeFormatter newformatter =

protocol packets out of order

混江龙づ霸主 提交于 2021-02-08 19:27:27
问题 I recently uploaded my node.js app on A2 Hosting and I get this error : { Error: Packets out of order. Got: 80 Expected: 0 at Parser.write (/home/westudec/public_html/myapp/node_modules/mysql/lib/protocol/Parser.js:42:19) at Protocol.write (/home/westudec/public_html/myapp/node_modules/mysql/lib/protocol/Protocol.js:39:16) at Socket.<anonymous> (/home/westudec/public_html/myapp/node_modules/mysql/lib/Connection.js:103:28) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at

QT5.9连接MySQL5.7解决QSqlDatabase: QMYSQL driver not loaded问题

偶尔善良 提交于 2021-02-08 18:00:29
QT5.9连接MySQL5.7解决QSqlDatabase: QMYSQL driver not loaded问题 参考文章: (1)QT5.9连接MySQL5.7解决QSqlDatabase: QMYSQL driver not loaded问题 (2)https://www.cnblogs.com/linzijie1998/p/11096167.html 备忘一下。 来源: oschina 链接: https://my.oschina.net/u/4437974/blog/4950977

整体算力提升40% 芯片级安全防护 | 阿里云发布第七代ECS云服务器

会有一股神秘感。 提交于 2021-02-08 17:47:52
2 月 8 日,阿里云宣布推出第七代 ECS 云服务器产品家族,基于最新的神龙架构,相较于上一代整体算力提升 40%,容器部署密度最大可提升 6 倍,是最佳的云原生载体,此外全量搭载安全芯片,实现“全方位立体化防护”,为云上企业提供金融级的安全可信环境,目前官网已全面开启邀请测试。 据悉,阿里云第七代 ECS 提供了极致性能的云原生算力,搭载了基于 IceLake 架构的第三代英特尔®至强®可扩展处理器,包括通用型 g7、计算型 c7 和内存型 r7 三个系列实例。存储方面,云盘挂载密度最多提升 1 倍,最大吞吐能力提升 1 倍,最大 IOPS 提升 1 倍;网络方面升级至 50GX2 物理网络,支持大帧传输、转发效率提升近 5 倍。 此外,第七代 ECS 还能在 3 分钟交付 50 万核 vCPU, 单实例启动 10 秒,极好地满足了用户对容器等资源极速弹性的需求,是云原生的最佳载体。 在具体场景方面,第七代 ECS 的表现也很优异,如 MySQL、Redis、Nginx 等互联网高负载场景性能最大提升 50%;在视频转码的场景下,性能最多可提升 40%;在区块链计算场景下,性能最大提升 10 倍。 随着越来越多的企业迁移上云,基础设施的安全保障和数据安全持续受到关注。据悉,阿里云为新一代 ECS 设计了全新的安全立体化防护方案,首次全量搭载安全芯片作为硬件可信根

How to extract a value from a JSON string by key

心不动则不痛 提交于 2021-02-08 17:25:20
问题 I have a column which has Json string records. I want to parse the json and fetch the value of a particular key from within the select statement. Sample JSON {"kofaxDocId":"8ae16f46-c68f-11e5-8105-0e15fb39b661","systemDocType":"Loan Application","requestId":"c770a940-b9f3-4c41-aee6-3e08c1470ec6","docType":"Loan Application","confidence":0.6499999761581421,"engineType":"kofax","completionStatus":"Suggested"} I want my select query to fetch only the value of the key "confidence". I tried using

How to extract a value from a JSON string by key

我们两清 提交于 2021-02-08 17:24:35
问题 I have a column which has Json string records. I want to parse the json and fetch the value of a particular key from within the select statement. Sample JSON {"kofaxDocId":"8ae16f46-c68f-11e5-8105-0e15fb39b661","systemDocType":"Loan Application","requestId":"c770a940-b9f3-4c41-aee6-3e08c1470ec6","docType":"Loan Application","confidence":0.6499999761581421,"engineType":"kofax","completionStatus":"Suggested"} I want my select query to fetch only the value of the key "confidence". I tried using