Tag Info

New answers tagged

0

There are multiple type of locks in Mysql. LOCK IN SHARE MODE in a shared mode lock on any rows that are read. So you need to pay attention to your query, how many rows are read (look also at examined column when doing explain). The isolation level will also affect behaviors of certain locks. I strongly advise to let Mysql take care of the locks. When an ...


0

I have a more direct way to upgrade from MySQL 5.1 to 5.6 The idea is to do the following: Dump the mysql schema from MySQL 5.1 as pure SQL into a grants file Use pt-show-grants Emulate pt-show-grants Dump the data from MySQL 5.1 without the mysql schema into a data file Uninstall MySQL 5.1 Install MySQL 5.6 Load grants file into MySQL 5.6 Load data ...


0

Caveat: There are many details left out of these steps. Read the docs; find more forum entries; etc. Assuming you are starting with A<->B, meaning replication is established in both directions. Also assuming you are currently writing to only A. Plan A, just 2 servers Change to A->B: That is, STOP SLAVE on A. Upgrade in place B to 5.5. (Keep the ...


0

Move server-id=3 from under [mysqld_safe] and put under [mysqld] [mysqld] datadir=/data/mysql socket=/var/lib/mysql/mysql.sock user=mysql symbolic-links=0 server-id=3 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid #max_connections max_connections=400 symbolic-links=0 #skip-slave-start log-bin=/data/mysql/mysql-bin ...


2

I think the simplest would be: SELECT COUNT(DISTINCT policy, client) AS distinct_combinations FROM table_name ;


4

You can count distinct elements by running: select count(distinct policy_id, client_id) from policy_client; Another option would be to group by and count that: select count(*) from (select policy_id, client_id from policy_client group by 1,2) a; Run both version and see which one performs better on your dataset. A very quick way but not totally ...


0

SUGGESTION #1 Check the user in the Stored Procedure and leave if it is not the right user DELIMITER // CREATE DEFINER=`billy`@`%` PROCEDURE `fetchData`(IN `id` INT UNSIGNED) LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA SQL SECURITY DEFINER COMMENT 'Accepts an ID and returns the record' ThisStoredProcedure:BEGIN SET @cur_user = CURRENT_USER(); ...



Top 50 recent answers are included