mariadb

Trouble with REGEXP_REPLACE in MySQL 8

Deadly 提交于 2020-01-04 09:11:54
问题 I recently upgraded to MySQL 8 so that I can use the new Regular Expression functions (https://dev.mysql.com/doc/refman/8.0/en/regexp.html) to clean up a lot of bad addresses. However, I'm running into trouble using REGEXP_REPLACE. I'm starting by running a SELECT query as an example (so I can see what's going on before I run an UPDATE query): SELECT address1_raw, CONVERT(REGEXP_REPLACE (address1_raw, '^[0-9]+ ', '') USING UTF8) as replaced, CONVERT(REGEXP_SUBSTR(address1_raw, '^[0-9]+ ')

MySQL Update rows with double left join, limiting first match

痞子三分冷 提交于 2020-01-03 19:24:27
问题 I have three tables (SQLFiddle with tables created) Orange text is what I need to get by comparing Products.name with Filters.filter. I figured out that substring match can be done like this: on Products.name LIKE CONCAT('%',Filters.filter,'%'); I only need the first filter match to be used. So "Mushroom soup" will match "Soup" and not "Mushroom". What is best approach for this task? A tested SQLFiddle link, if possible, please. What I tried: ( feel free to skip everything below ) Tried

PhpMyAdmin: “Error in processing request :” (No error shown)

一曲冷凌霜 提交于 2020-01-02 23:59:07
问题 I'm running XAMPP on Windows 10 (64-bit) as a development environment. PhpMyAdmin recent started replying to every many attempted actions with the following error - without any actual information about the error. How can I move forward without receiving an error? Actions that DON'T work: Delete row Drop table Edit row Actions that DO work: View list of tables in a database Browse table View table structure Change details of column in a table's structure view For context, here is the version

前后端分离部署

你离开我真会死。 提交于 2020-01-02 21:37:00
部署总体: vue +uwsgi+django+mysql+redis 创建luffy文件夹: [root@localhost opt]# cd luffy 路飞学城django代码下载后端:wget https://files.cnblogs.com/files/pyyu/luffy_boy.zip解压 unzip luffy_boy.zipvue代码下载前端:wget https://files.cnblogs.com/files/pyyu/07-luffy_project_01.zip 创建新的虚拟环境: mkvirtualenv luffy 1.前端vue部署* * vue代码下载:wget https://files.cnblogs.com/files/pyyu/07-luffy_project_01.zip解析:unzip 2.下载node.js wget https://nodejs.org/download/release/v8.6.0/node-v8.6.0-linux-x64.tar.gz 解压:tar -zxvf node-v8.6.0-linux-x64.tar.gz 配置node的环境变量即可 luffy) [root@localhost node-v8.6.0-linux-x64]# cd bin 1.(luffy) [root@localhost

mysql主从复制

ε祈祈猫儿з 提交于 2020-01-02 21:36:34
mysql主从复制 1.centos7如何安装mysql 1.yum安装 2.源代码编译安装 3.rpm包安装 yum安装的前提条件,是准备yum源,可以选择清华园,阿里源,等等 1.安装mariadb的yum源有两,一个是阿里云,版本低,功能小 命令:yum install mariadb-server mariadb 2.mariadb官方的yum源,配置的方式 方法:在/etc/yum.repos.d/目录下创建repo文件就是yum仓库 1.创建一个mariadb.repo文件,写入如下内容 vim /etc/yum.repos.d/MariaDB.repo 2、添加repo仓库配置[mariadb]name = MariaDBbaseurl = http://yum.mariadb.org/10.1/centos7-amd64gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDBgpgcheck=1 3.安装官方mariadb命令 yum install MariaDB-server MariaDB-client -y 4.启动mariadb相关命令 mariadb数据库的相关命令是:​systemctl start mariadb #启动MariaDB​systemctl stop mariadb #停止MariaDB

118. OpenStack Stein版搭建

笑着哭i 提交于 2020-01-02 16:12:33
1. OpenStack简介 OpenStack 是一系列开源工具(或开源项目)的组合,主要使用池化虚拟资源来构建和管理私有云及公共云。其中的六个项目主要负责处理核心云计算服务,包括计算、网络、存储、身份和镜像服务。还有另外十多个可选项目,用户可把它们捆绑打包,用来创建独特、可部署的云架构。 1.1. 云计算模式 1、IaaS:基础设施即服务(个人比较习惯的):用户通过网络获取虚机、存储、网络,然后用户根据自己的需求操作获取的资源 2、PaaS:平台即服务:将软件研发平台作为一种服务, 如Eclipse/Java编程平台,服务商提供编程接口/运行平台等 3、SaaS:软件即服务 :将软件作为一种服务通过网络提供给用户,如web的电子邮件、HR系统、订单管理系统、客户关系系统等。用户无需购买软件,而是向提供商租用基于web的软件,来管理企业经营活动 2. OpenStack 项目介绍: OpenStack 架构由大量开源项目组成。其中包含 6 个稳定可靠的核心服务,用于处理计算、网络、存储、身份和镜像; 同时,还为用户提供了十多种开发成熟度各异的可选服务。OpenStack 的 6 个核心服务主要担纲系统的基础架构,其余项目则负责管理控制面板、编排、裸机部署、信息传递、容器及统筹管理等操作。 keystone :Keystone 认证所有 OpenStack 服务并对其进行授权。同时

Export SQL query to JSON formatted text file

谁说胖子不能爱 提交于 2020-01-02 15:25:57
问题 I need a way to run a SQL command and then export the results to a JSON formatted text file. I have this link: https://falseisnotnull.wordpress.com/2014/11/23/creating-json-documents-with-mariadb/ But I don't understand the CREATE_COLUMN section of his statement, nor really the terminology he uses to understand how it relates to my DB. Can anyone please simplify his example for me on a query like this? SELECT * FROM thisismy.database; If I do the above with the INTO OUTFILE command, I get

Export SQL query to JSON formatted text file

坚强是说给别人听的谎言 提交于 2020-01-02 15:25:20
问题 I need a way to run a SQL command and then export the results to a JSON formatted text file. I have this link: https://falseisnotnull.wordpress.com/2014/11/23/creating-json-documents-with-mariadb/ But I don't understand the CREATE_COLUMN section of his statement, nor really the terminology he uses to understand how it relates to my DB. Can anyone please simplify his example for me on a query like this? SELECT * FROM thisismy.database; If I do the above with the INTO OUTFILE command, I get

Mysterious error in CREATE PROCEDURE in MariaDB/MySQL

两盒软妹~` 提交于 2020-01-02 10:16:45
问题 I tried to make a simple procedure in MariaDB 10.2 but I encountered an issue regarding variables defining. I am receiving (conn:107) 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 '' at line 3 message when I declare a variable. I read the MariaDB documentation and I it says that a variable is defined like this DECLARE var_name [, var_name] ... type [DEFAULT value] Where I am wrong? I am coming from

What is the maximum number of table joins in MariaDB?

混江龙づ霸主 提交于 2020-01-02 04:53:07
问题 Is the number of table joins in MariaDB 10 limited to 61 as is the case for MySQL or another number? (I couldn't find the answer in the MariaDB documentation or by googling). 回答1: MariaDB has the same maximum number of 61 tables in a join. This query CREATE TABLE t (i INT(10) NOT NULL); select * from t a01 join t a02 join t a03 join t a04 join t a05 join t a06 join t a07 join t a08 join t a09 join t a10 join t a11 join t a12 join t a13 join t a14 join t a15 join t a16 join t a17 join t a18