Showing entries 11 to 20 of 127
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: data (reset)
Use MySQL UNIQUE Constraint in phpMyAdmin

The MySQL UNIQUE constraint is often used in a column definition in which we need each value for that column to be distinct from the others. Perhaps it is an email column for an on-line registration form and we want to ensure that users cannot register twice for an account using the same email. Whatever the case may be, UNIQUE is there to help us ensure this type of data integrity or business requirement. What if the target table already exists and you determine you need to add a UNIQUE constraint to an existing column? In this post, I will cover 2 ways you can implement a UNIQUE constraint on existing columns using the phpMyAdmin web interface…

Photo by Kaleidico on …

[Read more]
MySQL Shell Python mode for multiple ALTER TABLE statements – easily

There may come a time you need to rename one or more columns in an existing MySQL table for a variety of reasons. Using ALTER TABLE, to rename a column is an easy enough command. But, suppose there are multiple tables in the same database/schema that have the same-named column and all of those columns need to be renamed. That could be a lot of ALTER TABLE statements to type out. Save your energy and time, avoiding all of those ALTER TABLE commands all-together. If you are lucky enough to be working with a MySQL version > 8.0 then the Shell is your salvation. With just a few lines of Python code in \py mode, all of your trouble(s) and headache(s) are no more…

Photo by Ibrahim Rifath on …

[Read more]
MySQL EXTRACT() method for specific DATE and TIME values

Date and time values are some of the most important datatypes in an RDBMS. From tracking order dates to payroll hours, DATE and DATETIME datatypes are used in all types of applications. At times as a Developer, you may need only certain portions of a DATE or DATETIME value. In MySQL, the EXTRACT() function can provide you with a specific component of a DATE or DATETIME value depending on which INTERVAL is given as a parameter. Continue reading to see example EXTRACT() queries for understanding…

Photo by Omar Al-Ghossen on Unsplash

[Read more]
Dynamic MySQL CREATE TABLE statement with pandas and pyodbc

Have you ever had to type out a massive CREATE TABLE statement by hand? One with dozens of columns? Maybe several dozens of columns? There are likely some GUI tools to help with large CREATE TABLE commands. Or, other drag-n-drop types of software that I am not familiar with. What if you could write a few lines of Python code and take care of a huge CREATE TABLE statement with way less effort than typed manually? Interested? Continue reading and see how using pandas, pyodbc, and MySQL…

Photo by Vorsen Furniture on Unsplash

OS, Software, and DB used:

  • OpenSuse Leap 15.1
[Read more]
3 MySQL Commands Developers should know.

If you are a developer working in a MySQL environment, this blog post is for you. I share 3 MySQL commands or statements that you should know. That is a bold statement, I know. Turns out, once you do know (of) these commands, you will use them all the time. They minimize guesswork which leads to better productivity in other facets of your programming and querying workflow. I use them myself almost daily and am sure you will too once you see how simple they are to use. So why should you know them? Continue reading and find out…

Photo by hannah joshua on Unsplash

OS, Software, and DB used:

  • OpenSuse Leap 15.1
[Read more]
TRIM() string function in MySQL – with examples.

In this post, I’ll cover examples of the MySQL TRIM() function. TRIM() removes specific characters – or spaces – from a given string, at either: the beginning, ending, or potentially in both locations depending on several factors. With an optional keyword argument that controls which character(s) – if any – are removed, TRIM() can be tricky so let’s gain understanding with several easy-to-digest examples…

Photo by Peter Beukema on Unsplash

OS, Software, and DB used:

  • OpenSuse Leap 15.1
  • MySQL 8.0.20

Self-Promotion:

If you enjoy …

[Read more]
Important Health Checks for your MySQL Master-Slave Servers

In a MySQL master-slave high availability (HA) setup, it is important to continuously monitor the health of the master and slave servers so you can detect potential issues and take corrective actions. In this blog post, we explain some basic health checks you can do on your MySQL master and slave nodes to ensure your setup is healthy. The monitoring program or script must alert the high availability framework in case any of the health checks fails, enabling the high availability framework to take corrective actions in order to ensure service availability.

MySQL Master Server Health Checks

We recommended that your MySQL master monitoring program or scripts runs at frequent intervals. Assuming that the monitoring script is running on the same server as your …

[Read more]
How to Monitor MySQL Deployments with Prometheus & Grafana at ScaleGrid

Monitoring your MySQL database performance in real-time helps you immediately identify problems and other factors that could be causing issues now or in the future. It’s also a good way to determine which components of the database can be enhanced or optimized to increase your efficiency and performance. This is usually done through monitoring software and tools either built-in to the database management software or installed from third-party providers.

Prometheus is an open-source software application used for event monitoring and alerting. It can be used along with a visualization tool like Grafana to easily create and edit dashboards, query, visualize, alert on, and understand your metrics. ScaleGrid provides full admin access to your MySQL deployments – this makes it …

[Read more]
2019 Open Source Database Report: Top Databases, Public Cloud vs. On-Premise, Polyglot Persistence

Ready to transition from a commercial database to open source, and want to know which databases are most popular in 2019? Wondering whether an on-premise vs. public cloud vs. hybrid cloud infrastructure is best for your database strategy? Or, considering adding a new database to your application and want to see which combinations are most popular? We found all the answers you need at the Percona Live event last month, and broke down the insights into the following free trends reports:

[Read more]
MySQL Tutorial – Managing MySQL Server Logs: Rotate, Compress, Retain & Delete

MySQL Server generates several logs that can help you monitor the activities of the server. However, once these logs are enabled, they can grow in size and start taking up too much disk space. This is why it’s important to have an automated way of archiving and preserving MySQL log files for a certain duration, as well as deleting the old ones. In this blog post, we describe some best practices for setting up and managing MySQL error logs, general logs and slow query logs for your MySQL deployments.

Setting Up MySQL Server Logging

Let’s look at how to setup the following 3 types of logs:

Error Log

Logs all the problems encountered during starting, running, or stopping mysqld. This log can be enabled by having the following option in /etc/my.cnf file:

[Read more]
Showing entries 11 to 20 of 127
« 10 Newer Entries | 10 Older Entries »