mariadb

MariaDB远程连接问题

百般思念 提交于 2020-01-18 19:25:04
MariaDB在设置完通过Navicat Premium远程连接账号验证通过,但是无法正常使用工具的功能,只能使用sql语句查询,但是通过控制台命令功能正常。 经过修改账号权限,添加新用户等功能都无法实现工具连接MariaDB数据库,尝试将MariaDB数据库端口从3306改为3336后奇迹般的可以连接了,猜测MariaDB数据MySQL的分支项目,其大部分连接操作都和MySQL一致,可能在连接的特殊情况下无法正常识别数据库类型。   来源: https://www.cnblogs.com/umeall/p/10372845.html

mysql间隙锁

百般思念 提交于 2020-01-18 17:43:32
什么是间隙锁(gap lock)?   间隙锁是一个在索引记录之间的间隙上的锁。 间隙锁的作用?     保证某个间隙内的数据在锁定情况下不会发生任何变化。比如我mysql默认隔离级别下的可重复读(RR)。    当使用唯一索引来搜索唯一行的语句时,不需要间隙锁定 。如下面语句的id列有唯一索引,此时只会对id值为10的行使用记录锁。     select * from t where id = 10 for update;// 注意:普通查询是快照读,不需要加锁   如果,上面语句中id列没有建立索引或者是非唯一索引时,则语句会产生间隙锁。   如果,搜索条件里有多个查询条件(即使每个列都有唯一索引),也是会有间隙锁的。   需要注意的是,当id列上没有索引时,SQL会走聚簇索引的全表扫描进行过滤,由于过滤是在MySQL Server层面进行的。因此每条记录(无论是否满足条件)都会被加上X锁。但是,为了效率考量,MySQL做了优化,对于不满足条件的记录,会在判断后放    锁,最终持有的,是满足条件的记录上的锁。但是不满足条件的记录上的加锁/放锁动作是不会省略的。所以在没有索引时,不满足条件的数据行会有加锁又放锁的耗时过程。 间隙的范围?   根据检索条件向下寻找最靠近检索条件的记录值A作为左区间,向上寻找最靠近检索条件的记录值B作为右区间,即锁定的间隙为(A,B] 左开右闭 。

mariadb应用系列之(三)基于maxscale的读写分离架构

早过忘川 提交于 2020-01-18 09:53:20
1. 环境说明 软件版本 操作系统:CentOS Linux release 7.3.1611 (Core) (3.10.0-514.el7.x86_64) MariaDB-server:10.2.30 maxscale:2.3.8 硬件环境 node1 172.16.100.51 maxscale node2 172.16.100.52 mariadb-server node3 172.16.100.53 mariadb-server node3 172.16.100.54 mariadb-server 2. 中间件配置(on node1) 配置文件:/etc/maxscale.cnf server定义 [server1] type=server address=172.16.100.52 port=3306 protocol=MariaDBBackend [server2] type=server address=172.16.100.53 port=3306 protocol=MariaDBBackend [server3] type=server address=172.16.100.54 port=3306 protocol=MariaDBBackend monitor定义 [MariaDB-Monitor] type=monitor module=mariadbmon

一文搞定Spring Boot + Vue 项目在Linux Mysql环境的部署(强烈建议收藏)

£可爱£侵袭症+ 提交于 2020-01-18 08:26:04
本文介绍Spring Boot、Vue 、Vue Element编写的项目,在Linux下的部署,系统采用Mysql数据库。按照本文进行项目部署,不迷路。 1. 前言 典型的软件开发,经过“需求分析”,“概要设计”,“详细设计”,“开发及单元测试”,“前后端联调”,“生产环境上线”。到了发布到生产环节的环节,紧张的神经,终于可以松一口气了!!! 且慢,部署也是很重要的一环,稍有不慎就会“前功尽弃”。 开发中,每个人的开发环境、工具可能都不同。目前大部分人用Windows(Win 10)开发,部分用Mac系统开发,还有极少数用Linux系统开发。但,为了运行的稳定,开发的系统大部分都部署在Linux平台。本文采用Centos 7部署Spring Boot项目,并介绍前后端项目的打包和部署。 2. 部署过程说明 1)开发环境说明 本着一切为了“开发效率”,在项目开发的时候: 后端采用了IntelliJ IDEA作为Spring Boot的开发工具(其实用Eclipse也是Ok的),用了典型“controller、service、dao三层架构”; 前端采用Vs Code作为Vue及Vue Element的开发工具,用webpack进行项目打包,“地球人都知道,这里就不多啰嗦了”; 用Git作为分布式版本控制系统; Mysql数据; 用mybatis作为持久层框架。 2)Centos

python学习之关系型数据库作业

蹲街弑〆低调 提交于 2020-01-16 18:36:17
简答题 1.MySQL常见的三种存储引擎(InnoDB、MyISAM、MEMORY)的区别(至少5点)? l InnoDB存储引擎 InnoDB是事务型数据库的首选引擎,支持事务安全表(ACID),其它存储引擎都是非事务安全表,支持行锁定和外键,MySQL5.5以后默认使用InnoDB存储引擎。 InnoDB主要特性 为MySQL提供了具有提交、回滚和崩溃恢复能力的事务安全(ACID兼容)存储引擎。InnoDB锁定在行级并且也在 SELECT语句中提供一个类似Oracle的非锁定读。这些功能增加了多用户部署和性能。在SQL查询中,可以自由地将InnoDB类型的表和其他MySQL的表类型混合起来,甚至在同一个查询中也可以混合。 。 l MyISAM存储引擎 MyISAM基于ISAM存储引擎,并对其进行扩展。它是在Web、数据仓储和其他应用环境下最常使用的存储引擎之一。MyISAM拥有较高的插入、查询速度,但不支持事务,不支持外键。 MyISAM主要特性: 被大文件系统和操作系统支持。 当把删除和更新及插入操作混合使用的时候,动态尺寸的行产生更少碎片。这要通过合并相邻被删除的块,若下一个块被删除,就扩展到下一块自动完成。 每个MyISAM表最大索引数是64,这可以通过重新编译来改变。每个索引最大的列数是16。 最大的键长度是1000字节,这也可以通过编译来改变

Maria db how to use groups, unions, and/or sum/count in a select query

。_饼干妹妹 提交于 2020-01-16 16:49:29
问题 I've been breaking my mind for three days trying to puzzle this one out. I'm new to Maria db and sql in general. I've managed to use UNION on a previous similar situation but it's not working in this one. I have three tables as follows: create table zipcode (zip int, city varchar(30)) create table student (id int, zip_fk int) create table teacher (id int, zip_fk int) I want to create a select query that will have the following fields: city, the number of students from the city, the number of

Maria db how to use groups, unions, and/or sum/count in a select query

倾然丶 夕夏残阳落幕 提交于 2020-01-16 16:49:28
问题 I've been breaking my mind for three days trying to puzzle this one out. I'm new to Maria db and sql in general. I've managed to use UNION on a previous similar situation but it's not working in this one. I have three tables as follows: create table zipcode (zip int, city varchar(30)) create table student (id int, zip_fk int) create table teacher (id int, zip_fk int) I want to create a select query that will have the following fields: city, the number of students from the city, the number of

Laravel Migration Returning Invalid SQL

左心房为你撑大大i 提交于 2020-01-16 07:59:09
问题 I am running Laravel 6.0.2 and my migration up method is as follows: Schema::create('users', function (Blueprint $table) { $table->increments('id'); $table->string('first_name'); $table->string('last_name'); $table->string('email')->unique(); $table->string('password'); $table->boolean('admin')->default(false); $table->boolean('manager')->default(false); $table->rememberToken(); $table->timestamps(); }); create table `users` ( `id` int unsigned not null auto_increment primary key, `first_name

CentOS7安装MariaDB10.1.14

夙愿已清 提交于 2020-01-16 05:08:45
1、下载MariaDB 下载地址:https://downloads.mariadb.org/mariadb/10.1.14/ 这里选择mariadb-10.1.14-linux-x86_64.tar.gz,下载过程中如果出现404错误,可以在网站右下角选择其他镜像地址,下载完成后,使用pscp工具将其传送到CentOS中 2、解压缩 [root@localhost ~]# cd /usr/local/ [root@localhost local]# tar -zxvf mariadb-10.1.14-linux-x86_64.tar.gz [root@localhost local]# mv mariadb-10.1.14-linux-x86_64 mysql 3、初始化数据库 [root@localhost local]# groupadd mysql [root@localhost local]# useradd -r -g mysql -s /bin/false mysql [root@localhost local]# cd mysql [root@localhost mysql]# chown -R root:root . [root@localhost mysql]# chown -R mysql:mysql data [root@localhost mysql]#

centos如何搭建lamp环境

我怕爱的太早我们不能终老 提交于 2020-01-16 03:51:05
用yum快速搭建LAMP平台 实验环境: [root@nmserver-7 html]# cat /etc/redhat-release CentOS release 7.3.1611 (AltArch) [root@nmserver-7 html]# uname -a Linux nmserver-7.test.com 3.10.0-514.el7.centos.plus.i686 #1 SMP Wed Jan 25 12:55:04 UTC 2017 i686 i686 i386 GNU/Linux 1、安装apache   1.1 安装apache [root@nmserver-7 ~]# yum install httpd httpd-devel   1.2 启动apache服务 [root@nmserver-7 ~]# systemctl start httpd   1.3 设置httpd服务开机启动 [root@nmserver-7 ~]# systemctl enable httpd Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.   1.4 查看服务状态 [root