Archive

Archives pour 12/2023

How To Improve Database Searches with Full-Text Search in MySQL 5.6 on Ubuntu 16.04

29/12/2023 Comments off

Introduction

Full-text search, or FTS, is a technique used by search engines to find results in a database. You can use it to power search results on websites like shops, search engines, newspapers, and more.

More specifically, FTS retrieves documents that don’t perfectly match the search criteria. Documents are database entities containing textual data. This means that when a user searches for « cats and dogs », for example, an application backed by FTS is able to return results which contain the words separately (just « cats » or « dogs »), contain the words in a different order (« dogs and cats »), or contain variants of the words (« cat » or « dog »). This gives applications an advantage in guessing what the user means and returning more relevant results faster.

Technically speaking, database management systems (DBMS) like MySQL usually allow partial text lookups using LIKE clauses. However, these requests tend to underperform on large datasets. They’re also limited to matching the user’s input exactly, which means a query might produce no results even if there are documents with relevant information.

Using FTS, you can build a more powerful text search engine without introducing extra dependencies on more advanced tools. In this tutorial, you will use MySQL 5.6 to query a database using full-text search, then quantify the results by their relevance to the search input and display only the best matches.

 

Prerequisites

Before you begin this tutorial, you will need:

Lire la suite…

Categories: Système Tags:

How To Install and Secure phpMyAdmin on Ubuntu 16.04

28/12/2023 Comments off

Introduction

While many users need the functionality of a database management system like MySQL, they may not feel comfortable interacting with the system solely from the MySQL prompt.

phpMyAdmin was created so that users can interact with MySQL through a web interface. In this guide, we’ll discuss how to install and secure phpMyAdmin so that you can safely use it to manage your databases from an Ubuntu 16.04 system. 

Prerequisites

Before you get started with this guide, you need to have some basic steps completed.

First, we’ll assume that you are using a non-root user with sudo privileges, as described in steps 1-4 in the initial server setup of Ubuntu 16.04.

We’re also going to assume that you’ve completed a LAMP (Linux, Apache, MySQL, and PHP) installation on your Ubuntu 16.04 server. If this is not completed yet, you can follow this guide on installing a LAMP stack on Ubuntu 16.04.

Finally, there are important security considerations when using software like phpMyAdmin, since it:

  • Communicates directly with your MySQL installation
  • Handles authentication using MySQL credentials
  • Executes and returns results for arbitrary SQL queries

For these reasons, and because it is a widely-deployed PHP application which is frequently targeted for attack, you should never run phpMyAdmin on remote systems over a plain HTTP connection. If you do not have an existing domain configured with an SSL/TLS certificate, you can follow this guide on securing Apache with Let’s Encrypt on Ubuntu 16.04.

Once you are finished with these steps, you’re ready to get started with this guide.

Lire la suite…

Categories: Bases de données Tags: , ,

How To Measure MySQL Query Performance with mysqlslap

28/12/2023 Comments off

Source: digitalocean

Introduction

MySQL comes with a handy little diagnostic tool called mysqlslap that’s been around since version 5.1.4. It’s a benchmarking tool that can help DBAs and developers load test their database servers.

mysqlslap can emulate a large number of client connections hitting the database server at the same time. The load testing parameters are fully configurable and the results from different test runs can be used to fine-tune database design or hardware resources.

In this tutorial we will learn how to use mysqlslap to load test a MySQL database with some basic queries and see how benchmarking can help us fine-tune those queries. After some basic demonstrations, we will run through a fairly realistic test scenario where we create a copy of an existing database for testing, glean queries from a log, and run the test from a script.

The commands, packages, and files shown in this tutorial were tested on CentOS 7. The concepts remain the same for other distributions. Lire la suite…

DIY Stopwatch made out of Digital IC 4026 and 4017

27/12/2023 Comments off

 

Today we are about to see how to build a DIY stopwatch just using Digital IC’s 4026 and 4017. The most highlighting feature about this project is the fact that it doesn’t use any MCU to do the job. Even though using an MCU will be a lot better option still this project will be a great DIY for those who love to play with Digital chips. 

BLOCKS OF DIY STOPWATCH:

  1. Oscillator
  2. Display

OSCILLATOR BLOCK:

Oscillator provides the clock source for stopwatch we are about to build. The oscillator should provide an output clock frequency of about 1Hz. There are plenty of ways to do this but each method might differ in accuracy of output wave produced. Even a simple 555 timer can be used here, but temperature drift might affect the accuracy of output. The deviation of output might not be that big but its good to have it under consideration.

Crystal powered oscillator will be the perfect solution for this problem. We are not going to discuss the oscillator section briefly in this article since this 1 Hz oscillator circuit will do a pretty good job for our DIY stopwatch project. You can always use other 1Hz clock generator circuits rather than the crystal oscillators provided your application have some tolerance on the accuracy. Lire la suite…

Categories: Électronique Tags:

How do I… Stress test MySQL with mysqlslap?

27/12/2023 Comments off

One of the interesting new tools in MySQL 5.1.4 is mysqlslap, a load emulator that lets you see how well a particular query set or table engine performs under high-load conditions.

A query that consumes too many database resources may be the result of designing tables incorrectly, choosing the wrong table type, or creating an inefficient query. When a query eats up a lot of database resources, it can negatively affect other application components. By using mysqlslap to stress test a server in a non-public environment, you will discover these errors sooner, allowing you to you avoid a database meltdown once your application goes live.

This tutorial shows how you can use mysqlslap to run stress tests involving multiple clients, custom queries, different table engines, and much more. Lire la suite…