MySQL Tuning

If you already know how to deploy a MySQL database. You might want to skip this learning path, and instead explore the Learn how to Tune MySQL learning path. That learning path covers how to get more performance out of an Arm based MySQL server.

Arm deployment options

There are numerous ways to deploy MySQL on Arm. Bare metal, cloud VMs, or the various SQL services that cloud providers offer. If you already have an Arm system, you can skip over this subsection and continue reading.

MySQL Documentation

MySQL server is a large project with many features. The MySQL Reference Manual should be explored. Make sure you are looking at the documentation for the version of MySQL you are working with.

MySQL installation options

If you are using a cloud service like AWS RDS, then the installation of MySQL is handled by those services. However, if you are working with a bare metal or cloud node, there are a few different installation options . You should decide what approach you want to take for installing MySQL after reviewing the documentation.

MySQL Server Configuration

Getting MySQL server up and running is easy. This is because the default out of box configuration will work. However, this out of box configuration is most likely under optimized. In fact, a graph of the performance difference between an out of box MySQL server and a tuned server is shown in the Learn how to Tune MySQL learning path. That said, for the purpose of learning, it’s ok to start with the out of box configuration. Once you have that working, you should read the MySQL server configuration documentation , and follow the Learn how to Tune MySQL learning path.

Connect to Database

Installations of MySQL will also install a CLI client application called mysql. Once a database is up and running, this tool can be used to connect to the database and make sure it is working. Review the instructions on how to use the mysql CLI tool.

Shown below is sample output of what you should see when you connect to the database successfully.

    

        
        Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 8.0.32-0ubuntu0.22.04.2 (Ubuntu)

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

        
    

Sample MySQL Commands

There are plenty of resources that explain how to do basic interactions with a MySQL database. That said, a few basic command examples are shown below.

Create a data base:

    

        
        
            create DATABASE arm_test;
        
    

List available databases:

    

        
        show databases;
__output__+--------------------+
__output__| Database           |
__output__+--------------------+
__output__| arm_test           |
__output__| information_schema |
__output__| mysql              |
__output__| performance_schema |
__output__| sys                |
__output__+--------------------+
__output__5 rows in set (0.10 sec)

        
    

Access the database:

    

        
        use arm_test;
__output__Database changed

        
    

List tables in the database:

    

        
        show tables;
__output__Empty set (0.09 sec)

        
    

Create a table:

    

        
        create table book(name char(10),id varchar(10));
__output__Query OK, 0 rows affected (0.12 sec)

        
    

Insert values into the table:

    

        
        insert into book(name,id) values ('Abook','10'),('Bbook','20'),('Cbook','20'),('Dbook','30'),('Ebook','45'),('Fbook','40'),('Gbook','69');
__output__Query OK, 7 rows affected (0.11 sec)
__output__Records: 7  Duplicates: 0  Warnings: 0

        
    

Display information about the table:

    

        
        describe book;
__output__+-------+-------------+------+-----+---------+-------+
__output__| Field | Type        | Null | Key | Default | Extra |
__output__+-------+-------------+------+-----+---------+-------+
__output__| name  | char(10)    | YES  |     | NULL    |       |
__output__| id    | varchar(10) | YES  |     | NULL    |       |
__output__+-------+-------------+------+-----+---------+-------+
__output__2 rows in set (0.10 sec)

        
    

Access the content of the table:

    

        
        select * from book;
__output__+--------+------+
__output__| name   | id   |
__output__+--------+------+
__output__| Abook  | 10   |
__output__| Bbook  | 20   |
__output__| Cbook  | 20   |
__output__| Dbook  | 30   |
__output__| Ebook  | 45   |
__output__| Fbook  | 40   |
__output__| Gbook  | 69   |
__output__+--------+------+
__output__7 rows in set (0.09 sec)

        
    
Back
Next