Search Posts

Category: mariadb

Connection to MySQL server of Raspberry Pi does not work

how to – Connection to MySQL server of Raspberry Pi does not work I have two Raspbery PI 3 which I have installed (almost) identical. The configuration of /etc/mysql/mariadb.conf.d/50-server.cnf is identical for both Raspberrys. Problem: I can only connect to the mysql database of one of these Raspberrys telnet raspberry1 3306 works perfect, while telnet raspberry2 3306 tells me that a connection cannot be established. A ping works from my windows pc to both raspberrys. […]

How to correct a reset of a increasing value in MySql Table

how to – How to correct a reset of a increasing value in MySql Table Im using a MySql table, to save sensor values I collect over RS485. The sensor sums up the charge, that has already gone into the battery. It’s positive when discharged and negative when charged. Sadly I reset the measuring module on accident.. So my charge drops 161 A/h from one row to the other, and new data is related to […]

last record in multiple tables

how to – last record in multiple tables I need to get the last record of a serial taking into account that you have to search in all these tables with the following nomenclature, registers_2017_01, registers_2017_02 etc. I tried as below SELECT c.name,SUBSTRING(c.name_fantasy,1,30) AS name_fantasy,CONCAT(v.title,’ ‘,v.plaque) AS title,v.type_vehicle,r.id,r.sn,r.lat,r.lng, r.direction,r.date_db,r.date_gps,r.volt_main,r.in1,r.in2,r.in3,r.speed,r.ign,r.sat_fix,r.sat,i.name_in1,i.name_in2,i.name_in3,i.name_in4,i.name_in5,i.name_in6,i.name_out1,i.name_out2,i.name_out3,i.name_out4,i.name_out5,i.name_out6 FROM clients c JOIN vehicles v ON c.id = v.clients_id JOIN installations i ON v.id = i.vehicles_id JOIN trackers t ON i.trackers_id = t.id JOIN registers […]

error when transfer from mysql to mariadb

how to – error when transfer from mysql to mariadb I yum remove mysql 5.7 and yum install mariadb 10.2 in centos 6. When I run mysql_upgrade –verbose, all tables are OK but I notice below problems: Phase 2/7: Installing used storage engines Checking for tables with unknown storage engine All tables are MYISAM, why areunknown storage engine? Error : Table ‘performance_schema.memory_summary_by_host_by_event_name’ doesn’t exist status : Operation failed sys.host_summary_by_file_io Error : Cannot load from mysql.proc. […]

Validation for invalid string value Mysql : ‘xD9xBExD8xA7xDAxA9

how to – Validation for invalid string value Mysql : ‘xD9xBExD8xA7xDAxA9 I want to validate user input whether user is inserting invalid text or copy pasting invalid characters on textbox. This exception usually occurs when user is inserting text from any other language. I want regular expression or any other method to validate user input Source: Stackoverflow

$wpdb->get_results query returns different (wrong) results compared to phpmyadmin

how to – $wpdb->get_results query returns different (wrong) results compared to phpmyadmin I have 4 custom tables in my database – wp_api_teams, wp_api_matches, wp_api_competitions and wp_api_federations. They are part of my WordPress database, this is how they look (I’m using foreign keys and all of that): I am trying to output all the teams that are part of a federation. When I run this in phpmyadmin it works: SELECT wp_api_teams.team_id, wp_api_teams.title, wp_api_competitions.comp_id, wp_api_competitions.title, wp_api_federations.federation_id, wp_api_federations.title […]

How do I read a group_id from a table? (RedBeanPHP)

how to – How do I read a group_id from a table? (RedBeanPHP) I create my site on php and now I’m creating a CP (Control Panel), for this I want to create two groups of users (default / admin). In the database, I create a column called “group_id” that stores data about the user group. To prevent normal users from accessing the CP, I need to check their group_id. The problem is that I […]

How do I encode characters from latin1 varchar in SQL Server to insert into MariaDB utf8?

how to – How do I encode characters from latin1 varchar in SQL Server to insert into MariaDB utf8? Currently I do an extract with SQLCMD from an old SQL Server DB where the varchar column is latin1 and I generate INSERT statements into a file to load the data into a MariaDB database: INSERT INTO maria_table (id, name, description) VALUES (210,’ALL.M.USDBBL’,’Refining GOA All Monthly’) ,(211,’S.M.USDBBL’,’RefinGdd 2 BBL’ ,(212,’R.M.USDBBL’,’RefinGdd 2BL’) , etc using the SQL […]

How to make WITH RECURSIVE query runable in lower version of MySQL? [duplicate]

how to – How to make WITH RECURSIVE query runable in lower version of MySQL? [duplicate] This question already has an answer here: Count all child nodes of hierarchical data in a table 3 answers Querying a count of items of a tree 4 answers in local env (MariaDB 10.2.10) I’m using function ‘no_of_descendants’ to count how many descendants has current user: DELIMITER // CREATE FUNCTION no_of_descendants (f_id INT) RETURNS INTEGER BEGIN DECLARE numberOf INT; […]

MariaDB Find Where Count() = 0

how to – MariaDB Find Where Count() = 0 I am trying to find what days do not have an entree(recipe_course=18), but all I am getting is a zero result. What am I missing? Two tables table recipes{recipe_id, recipe_name, recipe_course} table meals{meal_id, meal_date, meal_recipe} Select `meal_date` From `meals` mls Join `recipes` rrr on mls.`meal_recipe` = rrr.`recipe_id` Where rrr.`recipe_course` = 18 Group by `meal_date` Having Count(`recipe_course`) = 0 Source: Stackoverflow MariaDB

Next Page »