![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据库
automan_huyaoge
对智能机器人,无人驾驶感兴趣
展开
-
183. 从不订购的客户
SQL架构Create table If Not Exists Customers (Id int, Name varchar(255))Create table If Not Exists Orders (Id int, CustomerId int)Truncate table Customersinsert into Customers (Id, Name) values ('1', 'Joe')insert into Customers (Id, Name) values ('2',转载 2021-01-08 10:06:59 · 67 阅读 · 1 评论 -
182. 查找重复的电子邮箱
SQL架构Create table If Not Exists Person (Id int, Email varchar(255))Truncate table Personinsert into Person (Id, Email) values ('1', 'a@b.com')insert into Person (Id, Email) values ('2', 'c@d.com')insert into Person (Id, Email) values ('3', 'a@b.com'转载 2021-01-07 11:27:27 · 173 阅读 · 0 评论 -
181. 超过经理收入的员工
SQL架构Create table If Not Exists Employee (Id int, Name varchar(255), Salary int, ManagerId int)Truncate table Employeeinsert into Employee (Id, Name, Salary, ManagerId) values ('1', 'Joe', '70000', '3')insert into Employee (Id, Name, Salary, ManagerI转载 2021-01-07 11:23:58 · 92 阅读 · 0 评论 -
176. 第二高的薪水
SQL架构Create table If Not Exists Employee (Id int, Salary int)Truncate table Employeeinsert into Employee (Id, Salary) values ('1', '100')insert into Employee (Id, Salary) values ('2', '200')insert into Employee (Id, Salary) values ('3', '300')编写一.转载 2021-01-05 10:59:51 · 82 阅读 · 0 评论 -
175. 组合两个表
表1: Person+-------------+---------+| 列名 | 类型 |+-------------+---------+| PersonId | int || FirstName | varchar || LastName | varchar |+-------------+---------+PersonId 是上表主键表2: Address+-------------+---------+| 列名 ...转载 2021-01-05 10:54:20 · 160 阅读 · 0 评论 -
mysql模糊查询单引号 ‘报错
执行sql语句SELECT XX from yy.zz WHERE aa LIKE '%'%';报错Error Code:1064修改sql语句SELECT XX from yy.zz WHERE aa LIKE '%\\'%';python语句def FuzzyQuery(Qtable, Qcolumn, str): if int(Qtable) not in [0,1,2] or int(Qcolumn) not in [0,1,2,3,4]: .原创 2020-11-04 11:37:08 · 710 阅读 · 0 评论 -
mysql表空间加密
1)登陆mysqlmysql -u root -p2)安装keyring插件INSTALL PLUGIN keyring_file soname 'keyring_file.so';3)查看keyring插件show global variables like '%keyring_file_data%';show plugins;4)创建加密表create table test1( -> id int primary key auto_in原创 2020-08-28 17:07:42 · 679 阅读 · 0 评论 -
mysql接口报错
报错内容:libmysqlclient.so.20: cannot open shared object file: No such file or directory解决方法:sudo apt-get install libmysqlclient-dev原创 2020-08-28 16:57:30 · 140 阅读 · 0 评论 -
Mysql动态库的Cmake组织方式
CMakeLists.txtcmake_minimum_required (VERSION 3.5)project (demo)#set (SRC_LIST ${PROJECT_SOURCE_DIR}/tableInterface/tableInterface.cpp)aux_source_directory (tableInterface SRC_LIST)add_library (tableInterface_shared SHARED ${SRC_LIST})add_libra.原创 2020-08-27 15:18:22 · 242 阅读 · 0 评论 -
mysql设置服务器,被其他电脑访问
方法:修改文件 /etc/mysql/mysql.conf.d/mysqld.cnf, 注释bind-address = 127.0.0.1, 增加bind-address = 0.0.0.0#bind-address = 127.0.0.1bind-address = 0.0.0.0python访问数据库: mysql.connector访问服务器时报错:mysql.connector.errors.NotSupportedError: Authentication plu原创 2020-08-17 09:50:09 · 243 阅读 · 0 评论 -
C语言接口查询Mysql数据库,中文显示?
解决方法:在查询语句前加入如下代码,有两种方式:1) if (!mysql_set_character_set(&conn, "utf8")) { printf("New client character set: %s\n", mysql_character_set_name(&conn)); } printf("%s\n","设置字符格式为中文" );原创 2020-08-06 11:09:38 · 307 阅读 · 0 评论 -
编译程序找不到mysql.h
mysql.h:没有那个文件或者目录原:#include<mysql.h> 修改后:#include</usr/include/mysql/mysql.h> 或者#include <mysql/mysql.h>因为:/usr/inlcude/是gcc默认搜寻头文件的一个路径 而/include下有一个mysql目录名与mysql.h命名空间相同,系统不再向下查询。 即如果mysql目录不叫mysql 叫mysqlnew也不会出现这样的情况,所以在mysql....原创 2020-08-04 14:00:30 · 2040 阅读 · 0 评论 -
mysql -u root -p突然连接不上
在ubuntu系统中安装完MySQL后运行 mysql -u root -p发现报错如下提示:ERROR 1698 (28000): Access denied for user 'root'@'localhost'而用sudo mysql -u root -p 就可以正常登录,原因百度后好多帖子说是因为安装后没有设密码导致的,然后我按帖子说的设了密码,确实是可以免sudo登录MySQL了。具体操作步骤参考如下博客:https://blog.csdn.net/css33/article/d.原创 2020-08-04 15:26:54 · 1372 阅读 · 0 评论 -
C++连接Mysql示例
创建数据库创建一个用于练习的数据库test.进入mysql> 然后依次输入: mysql>create database test; mysql>use test; //切换到test数据库中 mysql> create table test(name varchar(255),num int(10) ); //创建一个叫test的表 mysql>show create table test; //显示刚才创建的表信息 ...原创 2020-08-04 15:17:35 · 193 阅读 · 0 评论