Community journal

The latest from the MySQL community

Ideas, releases, practical guides, and perspectives from the people building with MySQL.

Follow the feed
Showing entries 11701 to 11710 of 45503 « Previous | Next »
Deleting master logs script ONLY after checking slaves dont need them

 

You can use this script to purge master logs older than the day of the current log.  It checks the slaves are not using the older logs first. 

 

 

Some prechecks:

 

1) create a repl_client user on each slave - i.e

 

GRANT REPLICATION CLIENT ON *.* TO 'repl_client'@'mk-dbxx-1' IDENTIFIED BY 'r3pl';

 

2) Put the master and slave user, pwd and hosts in the section below.

 

3) Set savedays to number of days of logs to keep if more than today+1.

 

4) Make sure perl DBD and CALC modules are installed.

 

perl –v , 

 

instmodsh (and enter l to list modules)

 

5) The purge statement will not work if the "show master logs;" doesn't match up with the actual log files on disk.  This …

[Read more]
Deleting master logs older than one day in a single command

mysql -uroot –p*** -e 'show master logs; purge master logs before date_sub(now(), interval 1 day); show master logs;' 



sample output

 

 

+------------------+------------+

| Log_name         | File_size  |

+------------------+------------+

| mysql-bin.000325 | 1073741878 |

| mysql-bin.000326 | 532809491  |

+------------------+------------+

+------------------+------------+

| Log_name         | File_size  |

+------------------+------------+

| mysql-bin.000326 | 532809491  |

+------------------+------------+

 

 

Moving the whole datamysql base to a new location

Occasionally, mysql is installed in the wrong filesystem, and as the data build, the filesystem runs out of space. Moving the database is relatively straight forward

 

1.      Ensure there is a good, recent backup. Take an extra backup to be on the safe side

 

2.      Decide where the files will be moved to and create any subdirectories as required. Ensure the permissions are correct

 

            cd /local/mysql

            mkdir data

            chown mysql:mysql data

 

            root@compnode04[mysql] ls -ltr

…

[Read more]
Oracle AVDF post-installation configuration

In one of my last blog, named: "Oracle Audit Vault and Database Firewall (AVDF) 12.1 - installation on VirtualBox" I explained how to install AVDF on VirtualBox. Since some of you asked for a blog on "How to configure AVDF", I decided to write this posting on AVDF post-installation configuration. This one only concerns the post-installation phase, a third blog will be dedicated to practical cases concerning the configuration of Database Firewall Policies.

Specifying the Audit Vault Server Certificate and IP Address

You must associate each Database Firewall with an Audit Vault Server by specifying the server's certificate and IP address, so that the Audit Vault Server can manage the firewall. If you are using a resilient pair of Audit Vault Servers for high availability, you …

[Read more]
Codership named as 2014 Red Herring 100 Global Finalist

Finnish tech regains global recognition

 

Helsinki, Finland – 12 NOVEMBER 2014 – Codership, whose Galera Cluster technology brings high availability to open source databases worldwide, today announced it has been shortlisted for Red Herring’s 2014 Top 100 Global award. This prestigious recognition honours the year’s most audacious and far-reaching private technology companies and entrepreneurs across the globe.

 

Selected from over 1,000 companies from more than 40 nations, Helsinki-based Galera was shortlisted based on its ability to demonstrate innovative technologies which is helping to create new business models. The finalists were judged on a range of metrics, including financial performance, growth, management’s …

[Read more]
Everything about MySQL Users and Logins You Didn’t Know and Were Afraid to Ask

Logging into a MySQL server is generally dead simple—supply a username, a password, and you’re all set!

There are, however, more complex use cases such as when making use of our Enterprise Authentication plugins. It’s also sometimes helpful to have a more detailed understanding of what happens “under the hood”. So I’ll attempt to lift the hood and walk you through all of the nitty-gritty details regarding exactly just what happens when you log into a MySQL server.

Firstly, there are no less than 4 “users” involved in the authentication process. And a distinction between a user id and a user account exists. And it gets more and more advanced with each release. So I thought I’d take the time to try to walk you through the MySQL authentication process and clarify once and for all the stages involved, the information exchanged at each stage and the expected outcome.

I’ll use the tools that come …

[Read more]
Setting up a MySQL Enterprise Monitor 3 Test Environment

I wanted to quickly walk through my automated test environment setup for MySQL Enterprise Monitor (MEM). In doing so, I hope to help demonstrate how MEM 3 can easily be managed within an automated environment--whether you're using puppet, chef, cfengine, ansible, salt, $TheNextCoolDevOpsTool, or your own custom shell scripts like I am.

Here's how I setup my test environment:

1. I copy a "fresh" data directory into N locations.
shell# cat createtestenv.sh  #!/bin/sh
echo -n "Setting up fresh mysqld_multi setup..."
cp -R /var/lib/mysqlfresh /var/lib/mysql cp -R /var/lib/mysqlfresh /var/lib/mysql2 cp -R /var/lib/mysqlfresh /var/lib/mysql3 chown -R mysql:mysql /var/lib/mysql*
echo " done."
echo -n "Starting fresh mysqld instances..." /etc/init.d/mysql start echo " done."
2. I install the …

[Read more]
volatile considered harmful

While playing with MySQL 5.7.5 on POWER8, I came across a rather interesting bug (74775 – and this is not the only one… I think I have a decent amount of auditing and patching to do now) which made me want to write a bit on memory barriers and the volatile keyword.

Memory barriers are hard.

Like, super hard. It’s the kind of thing that makes you curse hardware designers, probably because they’re not magically solving all your problems for you. Basically, as you get more CPU cores and each of them have caches, it gets more expensive to keep everything in sync. It’s quite obvious that with *ahem* an eventually consistent model, you could save a bunch of time and effort at the expense of shifting some complexity into software.

Those in the MySQL world should recognize this – we’ve been dealing with asynchronous replication for well over a decade …

[Read more]
You can use MySQL for Visual Studio in Visual Studio 2013 Community edition

A lot a great announcements were done today at the Visual Studio Connect event. And one of the things we are more excited about is hearing that there is a new edition of Visual Studio: Visual Studio 2013 Community.

Log rotate and the (deleted) MySQL log file mystery

Did your logging stop working after you set up logrotate? Then this post might be for you.

Archive your log files!

Some time ago, Peter Boros wrote about Rotating MySQL Slow Logs safely, explaining the steps of a “best practice” log rotate/archive. This post will add more info about the topic.

When running logrotate for MySQL (after proper setting the /etc/logrotate.d/mysql conf file) from anacron, there’s a situation that you might potentially face if the user and password used to execute the “flush logs” command is stored in, for example, /root/.my.cnf file.

The situation:

You might find out that you have a new MySQL log file ready to receive data, but nothing is being written to it.

Why did this happen?

The logrotate script is executed, but the postrotate …

[Read more]