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 3351 to 3360 of 45460 « Previous | Next »
MySQL Shell 101 – System Log

One of the new features introduced in MySQL 8.0.24 was the ability to log all SQL statements that are issued in the MySQL Shell to the system log. This is a useful feature that can greatly assist in tracking who did what on the system.

Usage

The simplest way to utilize the new Shell logging feature is to simply start the MySQL Shell with the syslog option enabled like so:

$> mysqlsh --syslog --sql root@localhost

From this point forward all SQL entered in the MySQL Shell will be logged to the system log. For example, the following SQL is entered into the Shell:

MySQL  localhost:33060+ ssl  SQL > show databases;

+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+

We can now check the system log and verify that the statement above was indeed logged …

[Read more]
Using MySQL 8 Dual Passwords

MySQL 8 brought many highly anticipated features, with support for user roles, a new shell, a more robust data dictionary, and better SQL support, just to name a few. There are lesser-known new features, however, that aim to reduce overall DBA workload and streamline management processes – and one of these is support for dual passwords, first implemented in MySQL 8.0.14. User accounts are now permitted to have dual passwords, with a designated primary and secondary. This makes it possible to seamlessly perform user credential changes even with a large number of servers, or with multiple applications connecting to different MySQL servers.

Historically, a MySQL credential change had to be timed so that when the password change was made and propagated throughout the database nodes, all applications that use that account for connections had to be updated at the same time. This is problematic for many reasons, but with database and application …

[Read more]
Where’s the MySQL team from July - September 2021

As a continue of the previous announcement, please find below the list of shows where you can find MySQL Community and/or the MySQL team during the time of July - September 2021:

  • July 2021:

    • MySQL meetup / Virtual, July 7, 2021

      • Carsten Thalheimer and Abdullah Zarour, the MySQL Principal Solution Engineers will be talking about Oracle Cloud - MySQL Database Service & HeatWave (for Real-time Analytics). 
      • Scheduled for 5:00 PM to 7:00 PM GMT+4. Please make sure you have zoom registration on the …
[Read more]
Where’s the MySQL team from July - September 2021

As a continue of the previous announcement, please find below the list of shows where you can find MySQL Community and/or the MySQL team during the time of July - September 2021: July 2021: MySQL meetup / Virtual, July 7, 2021 Carsten Thalheimer and Abdullah Zarour, the MySQL Principal Solution Engi...

Installing Percona Server for MySQL on Rocky Linux 8

With the CentOS project switching its focus to CentOS Stream, one of the alternatives that aim to function as a downstream build (building and releasing packages after they’re released by Red Hat) is Rocky Linux. This how-to shows how to install Percona Server for MySQL 8.0 on the Rocky Linux distribution.

You can get the information on the distribution release version by checking the /etc/redhat-release file:

[root@rocky ~]# cat /etc/redhat-release
Rocky Linux release 8.4 (Green Obsidian)

Installing and Setting up the Percona Server for MySQL 8.0  Repository

…

[Read more]
MySQL meetup on MDS & HeatWave

We & local Oracle Cloud Community in Dubai are happy to announce upcoming MySQL OCI meetup scheduled for Wednesday, July 7th, 2021. Please find details below.

  • Date: Wednesday, July 7th, 2021
  • Time: 5:00 PM to 7:00 PM GMT+4
  • Topic: MySQL Database Services (MDS), MySQL HeatWave for Real-time Analytics, demos
  • Speaker: Carsten Thalheimer & Abdullah Zarour, the MySQL Principal Solution Engineers
  • Form: virtual event (via zoom)
  • More information & registration

 

MySQL meetup on MDS & HeatWave

We & local Oracle Cloud Community in Dubai are happy to announce upcoming MySQL OCI meetup scheduled for Wednesday, July 7th, 2021. Please find details below. Date: Wednesday, July 7th, 2021 Time: 5:00 PM to 7:00 PM GMT+4 Topic: MySQL Database Services (MDS), MySQL HeatWave for Real-time Analytics, ...

Percona Monitoring and Management – MySQL Semi-Sync Summary Dashboard

Some of you may use MySQL’s asynchronous replication feature called Semisynchronous Replication (aka semi-sync), and now with the MySQL Semi-Sync Summary Dashboard + Percona Monitoring and Management (PMM), you can see the most important metrics! Refer to the Install & Usage steps for deployment details (note you need Replication Set defined!).

What is Semisynchronous Replication

When enabled, Semisynchronous Replication instructs the Primary to wait until at least one replica has received and logged the event to the replica’s local relay log before completing the COMMIT on a transaction. This provides a higher level of data integrity because now it is known that the data exists in two places. This feature ensures a balance …

[Read more]
Automating MySQL Shell util.dumpInstance and util.dumpShema backups With CRON

    The UNIX/Linux cron command is a popular way to schedule repetitive tasks.  There are many examples on the web on how to use cron with mysqldump to backup MySQL Instances.  I am sure many systems have something similar to the following:

Local Host mysql Backup:
0 1 * * * /usr/bin/mysqldump -uroot -ppassword --opt myDatabase > /directory/MyDumpFilename.sql

    But what if you want to use the new, super-slick MySQL Shell dump utilities? Well, the good news is that it is as simple as it was with the old program. Want to use dumpSchema for the world schema?

0 1 * * * /usr/bin/ mysqlsh root@localhost -e "util.dumpSchemas(['world'],'/tmp/w2')"

    Or dump the entire instance?

0 2 * * * /usr/bin/mysqlsh root@localhost -e "util.dumpInstance('/tmp/i2',{ 'showProgress' : …

[Read more]
Title Case Anyone?

Sometimes life is too surreal. Like when somebody says, “How do you get title case in an Oracle database?” That’s when you know three things about the individual, while suppressing laughter. They’re not very experienced with SQL, likely lazy, and don’t read the documentation.

I had a little fun with somebody today by taking them down a small rat-hole. “Oh, gosh … ” I said, “… let’s write a function for that.” Here’s the joke function, like:

CREATE OR REPLACE
FUNCTION title_case
( string VARCHAR2 ) RETURN VARCHAR2 IS
BEGIN
  /* Change upper case to title case. */
  RETURN UPPER(SUBSTR(string,1,1)) || LOWER(SUBSTR(string,2,LENGTH(string)));
END title_case;
/

Then, we tested it with a query from the pseudo dual table:

SELECT title_case('incredible') AS "Proper Name" FROM dual;

It returned:

Proper Name
----------
Incredible

Then, I said “Oh, that’s not his …

[Read more]