This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USE sys; | |
| DELIMITER $$ | |
| CREATE FUNCTION my_id() RETURNS TEXT(36) DETERMINISTIC NO SQL RETURN (SELECT @@global.server_uuid as my_id);$$ | |
| -- previous obsolete function | |
| -- CREATE FUNCTION gr_member_in_primary_partition() | |
| -- RETURNS VARCHAR(3) | |
| -- DETERMINISTIC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # script used in consul | |
| # the following addition to sys is required: | |
| # https://gist.github.com/lefred/153448f7ea0341d6d0daa2738db6fcd8 | |
| # v.0.1 - lefred 2018-02-14 | |
| read -r mysql_primary mysql_readonly mysql_tx mysql_cert <<<$(mysql -h 127.0.0.1 -P 6446 -BNe "select * from sys.gr_member_routing_candidate_status") | |
| if [[ "${mysql_primary}" == "YES" ]] && [[ "${mysql_readonly}" == "NO" ]] | |
| then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # script used in consul to check if mysql is primary master and asynchronous slave | |
| # v.0.1 - lefred 2018-02-16 | |
| SLAVEOFDC="dc2" | |
| SLAVEUSER="async_repl" | |
| SLAVEPWD="asyncpwd" | |
| # check if we are the primary one | |
| ROLE=$(mysql -h 127.0.0.1 -BNe "select MEMBER_ROLE from performance_schema.replication_group_members where MEMBER_HOST=@@hostname") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USE sys; | |
| DELIMITER $$ | |
| CREATE FUNCTION my_id() RETURNS TEXT(36) DETERMINISTIC NO SQL RETURN (SELECT @@global.server_uuid as my_id);$$ | |
| -- new function, contribution from Bruce DeFrang | |
| CREATE FUNCTION gr_member_in_primary_partition() | |
| RETURNS VARCHAR(3) | |
| DETERMINISTIC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use sys; | |
| DROP VIEW IF EXISTS replication_status; | |
| CREATE | |
| ALGORITHM = MERGE | |
| SQL SECURITY INVOKER | |
| VIEW replication_status | |
| AS | |
| SELECT | |
| concat(conn_status.channel_name, ' (', worker_id,')') AS channel, | |
| conn_status.service_state AS io_state, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET GLOBAL log_bin_trust_function_creators = 1; | |
| USE sys; | |
| DROP FUNCTION IF EXISTS GTID_IS_EQUAL; | |
| DROP FUNCTION IF EXISTS GTID_IS_DISJOINT; | |
| DROP FUNCTION IF EXISTS GTID_IS_DISJOINT_UNION; | |
| DROP FUNCTION IF EXISTS GTID_NORMALIZE; | |
| DROP FUNCTION IF EXISTS GTID_UNION; | |
| DROP FUNCTION IF EXISTS GTID_INTERSECTION; | |
| DROP FUNCTION IF EXISTS GTID_SYMMETRIC_DIFFERENCE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <header> | |
| <title>PHP on OCI with MySQL Database Service</title> | |
| </header> | |
| <body> | |
| <center><h1>PHP on OCI with MySQL Database Service</h1></center> | |
| <hr> | |
| <?php | |
| $user = ""; | |
| $pwd = ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ $# -eq 0 ] | |
| then | |
| echo "A configuration file is required" | |
| exit 1 | |
| fi | |
| CONF_FILE=$1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ $# -eq 0 ] | |
| then | |
| echo "A configuration file is required" | |
| exit 1 | |
| fi | |
| CONF_FILE=$1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| create database mds; | |
| SET GLOBAL log_bin_trust_function_creators = 1; | |
| USE mds; | |
| DROP FUNCTION IF EXISTS get_gtid_to_skip; | |
| DELIMITER | | |
| CREATE FUNCTION get_gtid_to_skip() | |
| RETURNS LONGTEXT | |
| BEGIN |