Quantcast
Channel: MySQL Forums - Utilities
Viewing all 380 articles
Browse latest View live

Does Fabric work only with GTID based replication? (5 replies)

$
0
0
I have to support my database with MyISAM storage engine. So I try to configure Fabric to use Binary Log File Position Based Replication. But I couldn't get it work. Does Fabric work only with GTID based replication?

Thanks

2003: Can't connect to MySQL server on '127.0.0.1:3307' (111 Connection refused). (1 reply)

$
0
0
Hi all,

I am following this tutorial https://dev.mysql.com/doc/mysql-utilities/1.5/en/fabric-create-user.html

every time i use this command: sudo mysqlfabric group add my_group 127.0.0.1:3307

I get the following error:
Fabric UUID: 5ca1ab1e-a007-feed-f00d-cab3fe13249e
Time-To-Live: 1

ServerError: Error accessing server (127.0.0.1:3307): 2003: Can't connect to MySQL server on '127.0.0.1:3307' (111 Connection refused).

[name@computer/]$ sudo netstat -plutn | grep -i sql
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 22990/mysqld


I have found few suggestions which talk about privileges or using --bind-address=127.0.0.1 in my.cnf , however they didn't solve the issue.

any idea why I am getting this error?

Fabric project status (7 replies)

$
0
0
Hi there!

I'm new to mysql utilities and interested in fabric project status.

I've found that fabric available in utilities version 1.5.6 and as said in changelog has been moved to separate project in 1.6.2, also found a fabric repo on github, last activity about a year ago.

So I have several questions about fabric:

1. Is it alive?
2. Where could I find more info about project progress and roadmap?
3. If the project will not progress what mysql tool could be considered as an alternative?

Install warning message regarding attribute verification (1 reply)

$
0
0
I am installing mysql utilities 1.6.4 package on sparc solaris. I get lots of these but the package seems to install. I am only looking for the mysqldbcopy but how do I get rid of these? There is no doc that says I have to add the user or group? Do I specify a user and group at the command line? Do I add the user 'common' and group 'pb2user'.

Thanks for any help.

pkgadd -d ./mysql-utilities-1.6.4-solaris10.pkg

nstalling MySQL Utilities 1.6.4 (GPL)
...

## Installing part 1 of 1.
/usr/bin/mysqlauditadmin
ERROR: attribute verification of </usr/bin/mysqlauditadmin> failed
group name <common> not found in group table(s)
owner name <pb2user> not found in passwd table(s)
/usr/bin/mysqlauditgrep
ERROR: attribute verification of </usr/bin/mysqlauditgrep> failed
group name <common> not found in group table(s)
owner name <pb2user> not found in passwd table(s)
/usr/bin/mysqlbinlogmove
ERROR: attribute verification of </usr/bin/mysqlbinlogmove> failed
group name <common> not found in group table(s)
owner name <pb2user> not found in passwd table(s)
/usr/bin/mysqlbinlogpurge
...

Add shard to MySQL Fabric Cluster (1 reply)

$
0
0
Hi guys,

I have created a MySQL cluster base on this tutorial: https://dev.mysql.com/doc/mysql-utilities/1.5/en/fabric-quick-start-sharding-scenario.html.

But when I run command: mysqlfabric sharding add_shard 1 "group_id-1/1, group_id-2/100000, group_id-3/200000" --state=ENABLED , it happens below error:

DatabaseError: Error 'Operation CREATE USER failed for 'fabric_server'@'%'' on query. Default database: ''. Query: 'CREATE USER 'fabric_server'@'%' IDENTIFIED WITH 'mysql_native_password' AS '*14E65567ABDB5135D0CFD9A70B3032C179A49EE7''

DatabaseError: Command (SHOW SLAVE STATUS, ()) failed accessing (192.168.1.35:3306). MySQL Connection not available..

Would you help me check reason? Thank you so much!

Fabric LOG table not pruned (2 replies)

$
0
0
The LOG table in my mysql_fabric schema is growing by half a million rows per day. I have prune_time set to 3600 in both the [statistics] and [failure_tracking] sections of /etc/mysql/fabric.cfg.

Where should I be looking to figure out why old rows are not being deleted from the LOG table?

Fabric - Lazy way to fix FAULTY node in DEV environment (no replies)

$
0
0
In a dev environment where the time to simply restore the full database to the slave is shorter than the expected time to investigate the cause, what are the recommended mysqlfabric commands?

The following works for me, but is there a better procedure?

1) Remove faulty server from group with "mysqlfabric group remove"
2) Restore faulty server with "mysqlfabric server clone"'
2a) Run "FLUSH PRIVILEGES" in slave. (I should probably log an enhancement to include --flush-privileges in the mysqldump executed by the clone command)
3) Re-add server to group with "mysqlfabric group add"

MySQL Fabric - Failover Testing (no replies)

$
0
0
ENVIRONMENT
MySQL Enterprise 5.6.34
MySQL Utilities 1.5.6
MySQL Python Connector 2.1.0

I am testing high availability for MySQL and have created a 3 node replication group server1(master), server2 & server3(slaves). I have also installed MySQL Fabric on a separate server(fab1) and have successfully set up a Fabric group to monitor my 3 replication servers.

I have tested that failover works ok by shutting down server1 and seeing that server2 is promoted to be the primary and that replication continues to work ok. When I restart server1 and bring it back into the replication group as the master again it catches up on any updates and everything continues to work ok. So far I'm impressed and happy but this is all very basic stuff.

Next test was to switch master again by shutting down server1, again server2 is promoted to be the master server. I do some updates on server2 which are replicated to server3. I then restart server1 and promote it to be master and it catches up on updates made on server2 whilst it was down. Meanwhile, using the open client connection made when server2 was the primary, I make some further updates and drop a table. These do not get replicated to either server1 or server3 as the status of server2 within the Fabric group is now SECONDARY READ_ONLY. So now I have one server in my group that is out of sync with the others. When I try to do an update on server1(primary) to the table that was dropped on server2 I get a replication error and server2 required recovery.

As I'm fairly new to MySQL I'm guessing this is more to do with my lack of knowledge than a flaw in the design of MySQL & Fabric. Am I trying to do something it's not designed to do? Should I be checking all client connections are terminated prior to doing the 'failback' and making server1 the primary again?

Thanks in advance for you help. Regards Neil

MySQLDBCompare for two tables (no replies)

$
0
0
mysqldbcompare --server1=root:root@d m!n1@192.168.11.148:3306 --server2=root:rootc0n@dm!n1@192.168.11.148:3307 db1.accident_member:db2.accident_member --run-all-tests - -skip-checksum-table --changes-for=server2 --difftype=sql> "E:\ff.sql"

But it shows error, anyother option to be added on mysqldbcompare

Please help me in achieve this table to table data comparison using mysqldbcompare

mysqldbcompare ERROR: Comparing the same object on the same server (1 reply)

$
0
0
Dear All,

I get the following error while running the mysqldbcompare, your help will be greatly appreciated:


mysqldbcompare --server1=username:password@127.0.0.1 --server2=root:password@testdq01 --changes-for=server2 --skip-data-check --skip-row-count --difftype=sql --character-set=utf8 --skip-checksum-table --skip-table-options backlog:backlog
# WARNING: Using a password on the command line interface can be insecure.
# server1 on 127.0.0.1: ... connected.
# server2 on testdq01: ... connected.
ERROR: Comparing the same object on the same server.

The servers are *not* the same. How do I persuade mysqldbcompare that these are different servers?

Thanks,
racki

MySQLDUMP issue with backslash or special characters (2 replies)

$
0
0
Code: use test;

CREATE TABLE Test_user(Username VARCHAR(15),path VARCHAR(100));

INSERT INTO Test_user VALUES('new1','C:\newfolder\one.xlsx'); INSERT INTO Test_user VALUES('new1','C:/newfolder/one.xlsx');

I have created a .sql file using MySQLDump, which has contents

Filename : Table1.sql

DROP TABLE IF EXISTS test_user; /*!40101 SET @saved_cs_client = @@character_set_client /; /!40101 SET character_set_client = utf8 /; CREATE TABLE test_user ( Username varchar(15) DEFAULT NULL, path varchar(100) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES test_user WRITE; /*!40000 ALTER TABLE test_user DISABLE KEYS /; INSERT INTO test_user VALUES ('new1','C:\newfolderone.xlsx'),('new1','C:/newfolder/one.xlsx'); /!40000 ALTER TABLE test_user ENABLE KEYS */; UNLOCK TABLES;

in the above Table1.sql file ('new1','C:\newfolderone.xlsx') backslash before one.xlsx is not displaying , While trying to execute this file, i am getting output like this

new1 C:ewfolderone.xlsx new2 C:/newfolder/one.xlsx

Where it is not displaying \ at all , suggest me how to resolve it and also what are special characters like this backslash will create this kind of bug.

Thanks in advance..

database is overwritten (no replies)

$
0
0
Hello
A mysql database is overwritten ;so is that there a method to retrieve it via mysql-bin.000001 or other files
Thanks

mysqlfailover and redundancy (2 replies)

$
0
0
Hi,

We're looking at using msyqlfailover to automatically detect issues with our current master and deal with the subsequent failover operations for us.

One thing I haven't been able to find is a way to run more than one instance of mysqlfailover checking the same master (for redundancy purposes). If I just run one copy and the server it's running on dies I lose my automated failover capabilities until that's detected and fixed, but I can imagine that trying to run two copies at the same time might not end well if both of them decide to fail over at the same time.

Is there any recommended way to deal with this, or should I just try to work around it by implementing my own monitoring/locking mechanism?

Also, does anybody know what the status of the project now that InnoDB cluster is out? Will this get abandoned in favour of the clustering solution or will it continue to be worked on independently?

Thanks!

How to extract SQL from binlog (1 reply)

$
0
0
Hi,
I'm trying to extract SQL statements in one of my bin-log files using the mysqlbinlog utility but I'm getting output that is not readable.

Is this the correct command to extract SQL?

mysqlbinlog --no-defaults -v mysql-bin.002698


Thanks.

mysqldbreport not showing differences (8 replies)

$
0
0
i have installed the packages and ran the tool. i am not seeing differences but i know there are differences:

here is some details:

$ cat /etc/redhat-release
CentOS release 6.9 (Final)

$ rpm -qa --last | grep mysql
mysql-utilities-1.5.6-1.el6.noarch Sun 11 Jun 2017 06:09:34 PM UTC
mysql-utilities-extra-1.5.6-1.el6.noarch Sun 11 Jun 2017 05:44:58 PM UTC
mysql-connector-python-2.1.6-1.el6.i686 Sun 11 Jun 2017 05:44:58 PM UTC

I inserted new rows on localhost but the report does NOT show the difference in my table below:

# Defn Row Data
# Type Object Name Diff Count Check
# -------------------------------------------------------------------------
# TABLE policy_update pass pass -
# - Compare table checksum pass

# Databases are consistent.
#
# ...done


I appreciate any help.
Thank you.

Mysql Router service down on its own (no replies)

$
0
0
MySQL Router down on its own .

I can see below error in log files .

2017-06-21 10:27:18 INFO [7f94ed050700] [routing:read_write] 1 connection errors for <host-ip> (max 100)
2017-06-21 10:28:23 INFO [7f94ed050700] [routing:read_write] 2 connection errors for <host-ip> (max 100)
2017-06-21 10:28:23 INFO [7f94ed050700] [routing:read_write] 3 connection errors for <host-ip> (max 100)

Why router went down , is there any reason ?

How to use Shell to find out MySQL port number? (no replies)

$
0
0
Hi,

I just installed the shell utitlities tool. Googled to find out how to use the command line but to no avail.

Can someone direct me to a quick tutorial. Basically, I want to find out about the port number via command line. I am using MySQL workbench 6.3CE and running on windows OS.

Tks.

Does mysqlrplsync support the JSON column type? (1 reply)

$
0
0
Hi,

Recently we started using the new JSON column type in some of our databases running MySQL 5.7.18 (Community edition).

When we started adding the columns, mysqlrplsync (version 1.6.5) started reporting differences when we ran our checks. When I compare the two tables on the master and slave, visually they look the same to me.

Is there any way to get mysqlrplsync to explicitly show what the differences are?

Thanks.

Single Table Dump Extraction From A Combined Dump (no replies)

$
0
0
Post from: Sonika (Sr. DBA)

Introduction- The Issue
-----------------------
A MySQL DBA has at least once run into a situation where a 'key' small-sized table needs to be restored, MySQL_database and it is a part of a larger combined dump making it a time-consuming task to restore the entire dump in order to get the missing part restored.

Taking an outline scenario where a 7MB dump of the 'mysql' database having the 'user' table containing the access credentials needs to be urgently restored, however, this data is a part of the combined 10GB dump of all the databases in the server.

This post will provide you with the options on how to go about achieving the above objective in a simple and a timely manner.


The Resolution
--------------
Find a way out of this “dump” situation. By using the Linux command line stream editor 'sed' the problem was resolved in no time.

sed -n '/^CREATE TABLE `user`/,/^UNLOCK TABLES/p' alldatabases.sql > user.sql


The Internal Workings
---------------------
A mysqldump file when opened in any text editor, is simply a collection of SQL commands to recreate the entire database/databases. The file is heavily commented detailing what is being done.

The above Linux ‘sed’ command simply extracts all the required lines that state the activities that need to be recreated in the required table.

The highlighted part of the command indicates that anybody using the command will have to modify it as per details that one is trying to retrieve from the dump.

The steps for extracting ‘user’ table from the dump 'fulldump.sql' would be:

sed -n '/^CREATE TABLE `user`/,/UNLOCK TABLES/p' fulldump.sql > user.sql

Now I get the file 'user.sql' containing the sql commands to restore the table with the below command

mysql -u username -p <user.sql

There is another Linux command that can be used:

awk '/CREATE TABLE `user`/,/UNLOCK TABLES/{print}' alldatabases.sql > user.sql

The 'awk' command works just like the 'sed' one and extracts the information in between the highlighted texts, which contains the commands necessary to recreate the table.

Other than Linux editors, mysql also has a provision for selective restoration, although here it is limited to the database level.

mysql -u root -p --one-database test < alldatabases.sql

The switch '--one-database' is given to ignore statements except those for the default database named on the command line. For one to explore this option one needs to have access to the database.

For example if we want to restore the database named 'abc' from a combined dump named 'fulldump.sql' then:

mysql -uusername -ppassword –one-database test < fulldump.sql

NOTE: Before the above command a blank (empty) database named ‘test’ would need to be created.

This (--one-database) command has the limitation that the database containing the table will have to be restored to get to the required table. However this is less costly than restoring the entire dump containing several databases.


Conclusion
----------
As we can see, there can be several ways to resolve the extraction of the smaller dump. However, personally I would recommend the former Linux editor commands as it is a more clear and precise method to resolve the issue.

How to Capture Deadlocks in MySQL Instance (no replies)

$
0
0
The deadlocks can be rightly called the “show stoppers” for the production environments where the application transactions can get errors without any details being logged in the database systems. For instance, in the lower versions of MySQL (below 5.6), capturing the deadlock information is not available with the MySQL provided log files. This blog will help users/MySQL DBAs to capture such information by making use of a simple shell script and thus providing the important details regarding the deadlock errors.


InnoDB Diagonostics:

The principal source of information for InnoDB diagnostics is the output of SHOW ENGINE INNODB STATUS but there are some sections that are not very useful. For example, LATEST DETECTED DEADLOCK only shows, as the name implies, the latest error detected. If we have 100 deadlocks per minute we will be able to see only the latest one and that is incomplete information when you need to debug your application code.

We had resolved a similar issue for one of our esteemed clients, who have a huge MySQL Instance hosted with us.
This MySQL instance serves as an Online Transaction Processing (OLTP) Instance, implying that there is a high number transactions floating in the MySQL Instance.
The application running on top of this MySQL instance needs to have all the transactions logged successfully in case any issues are observed in the application’s transactions, the same needs to be attended immediately on the MySQL DB instance side.
As the deadlocks are internally resolved by MySQL instance by rolling-back the failed transactions, it becomes critical to log such actions and report such issues to dilute their impact on the applications and minimize the deadlock from happening again.

The issue was a tricky one as We only had access to the Database and no access to the application logs.
As the MySQL instance version was an older version the deadlock was not easily identifiable. We had to resolve this issue differently and was able to do so. The steps below cover the methodology adopted to help the client.

Inventory provided by client for this Issue:

1) Application logs showing the deadlock information and the transaction failures.

2) Timing of the deadlock occurrence.

3) Timing of the failed transaction.

Diagnosis & Analysis done to find where the Issue was:

The first two steps taken towards resolving the issue were:

1) We internally checked the MySQL instance for the deadlock information.

2) We rediscovered that it was the MySQL Instance being monitored in this case was not good enough to log its deadlock information in the alert files.

Resolution:

1) We created a deadlock capture script to monitor the deadlock information from the MySQL Instance.

2) We implemented the deadlock capture script in crontab of the MySQL DB host to query the MySQL instance every 10 minutes and report any future deadlock occurrence in the MySQL Instance due to application transactions.

Script used to capture the Deadlocks:

Below is the detailed script that was implemented:

#!/bin/ksh

a=`hostname`

LOG=/var/lib/mysql/FAKEPATH/deadlocks_status.log;export LOG

mysql -Bse "SHOW ENGINE INNODB STATUS\G" -u **** –p***** | awk '/LATEST DETECTED DEADLOCK/{f=1} /WE ROLL BACK TRANSACTION /{f=0;print} f' > $LOG



#------------Checking Log file for any errors----
valdump=`cat /var/lib/mysql/Fakepath/deadlocks_status.log |wc -l`
if [ $valdump = 0 ]
then
echo "No Issues"

else

errors=$(cat /var/lib/mysql/FAKEPATH/deadlocks_status.log)
echo "$errors" > /var/lib/mysql/FAKEPATH/current-deadlocks_status.log

if [ -e "/var/lib/mysql/FAKEPATH/prior-deadlocks_status.log" ]
then echo "prior-deadlocks_status.log Exists" > /dev/null
else
touch /var/lib/mysql/FAKEPATH/prior-deadlocks_status.log | echo "" > /var/lib/mysql/FAKEPATH/prior-deadlocks_status.log
fi

newentries=$(diff --suppress-common-lines -u /var/lib/mysql/FAKEPATH/prior-deadlocks_status.log /var/lib/mysql/FAKEPATH/current-deadlocks_status.log | grep '\+[0-9]')

if
test "$newentries" != "" && test "$errors" = ""
then echo "No New Errors" > /dev/null
elif
test "$newentries" != ""
then echo "$errors" | mailx -s "TRI-ALT:`hostname`:MySQL Instance Has New Deadlock Entries" client.mysql.mail@FAKEemail.com
echo "$errors" > /var/lib/mysql/FAKEPATH/prior-deadlocks_status.log
fi

fi

Crontab Entry Used:

00,10,20,30,40,50 * * * * /var/lib/mysql/FAKEPATH/check_deadlocks.ksh > /tmp/check_deadlocks.log 2>&1

Conclusion: Where the lower versions of MySQL instances do not have the capabilities to report or print all the deadlock information, the operating systems utilities can be efficiently utilized to capture them at regular intervals. Hence, providing a robust monitoring system to the users.

Note: - All above deadlock capture efforts were done in MySQL Instance version 5.0.45
Viewing all 380 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>