mariadb

源码编译安装 Mariadb-10.2.25

a 夏天 提交于 2020-01-06 22:00:45
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 源码编译安装 Mariadb-10.2.25 下载 http://ftp.hosteurope.de/mirror/archive.mariadb.org//mariadb-10.2.25/source/mariadb-10.2.25.tar.gz 解压 tar xvf mariadb-10.2.25.tar.gz 安装程序包 yum install bison bison-devel zlib-devel libcurl-devel libarchive-devel boost-devel gcc gcc-c++ cmake ncurses-devel gnutls-devel libxml2-devel openssl-devel libevent-devel libaio-devel 创建用户,数据库目录 useradd -r -s /sbin/nologin -d /data/mysql mysql mkdir /data/mysql chown mysql.mysql /data/mysql 编译安装 cd mariadb-10.2.25 cmake . -DCMAKE_INSTALL_PREFIX=/app/mysql -DMYSQL_DATADIR=/data/mysql/

简单web架构实例应用

♀尐吖头ヾ 提交于 2020-01-06 21:53:37
一、架构图 dns完成解析web1,web2来实现负载均衡 web1,web2使用后台的mysql数据库 web1,web2的页面数据全部放在nfs数据上,实现自动挂载 nfs服务器为web1,web2提供网页数据 10.7.2. 准备工作 设置ip信息 nmcli con add ifname ens33 con-name ens33 type ethernet ipv4.method manual \ ipv4.address 192.158.46.150/24 ipv4.gateway 192.168.46.1 Note 我使用的nmcli修改的ip,当然也是可以手工修改的。 10.7.3. ansible的配置 10.7.3.1. 安装ansible [root@localhost ~]# yum install ansible 10.7.3.2. 添加主机 需要添加如下内容到/etc/ansible/hosts文件中去。 [client] 192.168.46.159 [dns] 192.168.46.158 [web] 192.168.46.157 192.168.46.156 [db] 192.168.46.155 [nfs] 192.168.46.154 [self] 192.168.46.150 10.7.3.3. 配置免密码登陆

MariaDB cannot evaluate SELECT 1 WHERE NULL = NULL;

回眸只為那壹抹淺笑 提交于 2020-01-06 20:15:13
问题 I'm currently in process of learning SQL. I have an example from a book that I'm trying to understand, but MariaDB cannot evaluate it: SELECT 1 WHERE NULL = NULL UNION SELECT 0 WHERE NULL <> NULL; This however gives the following error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE NULL = NULL UNION SELECT 0 WHERE NULL <> NULL;' at line 2 I have tried: SELECT 1; which works.

MySQL / MariaDB unique BLOB of fixed length

南笙酒味 提交于 2020-01-06 19:31:14
问题 I need a 16-byte binary data column to be unique. Why can't a BLOB(16) be unique in MySQL and MariaDB, when it supports unique VARCHAR? That this is supported but not a fixed-length set of bytes seems nuts. Also, it's not acceptable to waste space by storing a binary value in base64 encoded strings. So, any better option than converting to/from two BIGINTs that make a composite unique index (this 16-byte binary is not used as a primary key, if it matters)? (Also, if I do use two BIGINTs, does

MariaDB: LEFT OUTER JOIN does not return row

允我心安 提交于 2020-01-06 18:00:21
问题 I already tried various types of JOINS but I am not able to get this simple query to work. I would like to have the result of table a in any case, even if there is no corresponding entry in table b. I tried: SELECT a.user_id, a.user_name, b.first_name FROM users a LEFT OUTER JOIN members b ON a.member_uid = b.uid WHERE (a.user_name = 'TEST' AND b.active = 1) In this case, there is no entry in b that has b.active = 1. But I assumed that all wanted columns from a would be returned and the

Ubuntu18.04安装MariaDB_10.4.x

假装没事ソ 提交于 2020-01-06 17:58:21
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> apt安装方法: 参考链接: https://downloads.mariadb.org/mariadb/repositories/#distro=Ubuntu&distro_release=bionic--ubuntu_bionic&mirror=tuna&version=10.4 方法1:注册repo # use root apt-get install software-properties-common apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://mirrors.tuna.tsinghua.edu.cn/mariadb/repo/10.4/ubuntu bionic main' 方法2:修改source # add source key curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash vim /etc/apt/sources.list # add this #

Pivot rows into columns

倾然丶 夕夏残阳落幕 提交于 2020-01-06 14:57:36
问题 I have an SQL query that generates the following: col1 | col2 | col3 ===================== item1 | key1 | value1 --------------------- item1 | key2 | value2 This is the query: SELECT t1.col1, t2.col2, t2.col3 FROM table1 t1 JOIN table2 t2 ON t1.id = t1.table1_id Data in table1: id | col1 ========= 1 | item1 2 | item1 Data in table2: table1_id | col2 | col3 ===================== 1 | key1 | item1 1 | key2 | item2 2 | key1 | item1 2 | key2 | item2 2 | key3 | item3 The number of rows is dynamic,

Getting whitelabel error page when running springboot application

偶尔善良 提交于 2020-01-06 12:13:05
问题 When i am running my springboot application by using ide it is working fine. But when i am running it's jar i am getting Whitelabel Error Page. Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Tue Oct 09 15:42:47 IST 2018 There was an unexpected error (type=Not Found, status=404). /WEB-INF/views/index.jsp pom.xml <?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven

load data infile is not allowed MariaDB

你离开我真会死。 提交于 2020-01-06 06:41:15
问题 I created a PHP script that imports posts from a CSV file into a WordPress website. To do this, I first bulk import the posts into a table of the WP website database and then the PHP script creates the posts. The bulk insert MYSQL query I use is the following: load data local infile '/var/www/vhosts/sitenamehere.test/test.csv' into table test_table character set latin1 fields terminated by ';' lines terminated by '\r\n' ignore 1 lines; When I run the script from the server I get the following

mariadb, is this kind of increment offset reaction consider normal?

人走茶凉 提交于 2020-01-06 05:57:11
问题 I posted a similar question a bit earlier but I was a bit confused because of the settings already set and by reading this http://mariadb.org/auto-increments-in-galera/ I totally understand and corrected the settings but from what I read the output of the auto increment id will be like both nodes are increment of 2 node 1 with offset 1 1,3,5,7 node 2 with offset 2 2,4,6,8 but when I create new rows...this happens create with node 1, node 1, node 2 would give me 1,3,4 it wouldn't give me 2