Узнать версию mariadb linux

6 Ways to Check your MariaDB Version

Here are six ways to check what version of MariaDB you’re currently running.

Option 1: The @@version Variable

The @@version variable contains the server version number. It may also include a suffix with configuration or build information.

You can retrieve its contents with a simple SELECT statement.

Option 2: The VERSION() Function

The VERSION() function returns the same information – the server version number, which may also include a suffix with configuration or build information.

This can be called using a SELECT statement. No arguments are required (or accepted).

Option 3: The SHOW VARIABLES Statement

The SHOW VARIABLES statement shows the values of MariaDB system variables.

You can use a WHERE clause to narrow the variables to just the version variable.

SHOW VARIABLES WHERE variable_name = 'version';
+---------------+----------------+ | Variable_name | Value | +---------------+----------------+ | version | 10.5.9-MariaDB | +---------------+----------------+

Alternatively, you can use a LIKE operator to return other variables that have version in their name.

SHOW VARIABLES WHERE variable_name LIKE '%version%';
+-----------------------------------+------------------------------------------+ | Variable_name | Value | +-----------------------------------+------------------------------------------+ | in_predicate_conversion_threshold | 1000 | | innodb_version | 10.5.9 | | protocol_version | 10 | | slave_type_conversions | | | system_versioning_alter_history | ERROR | | system_versioning_asof | DEFAULT | | tls_version | TLSv1.1,TLSv1.2,TLSv1.3 | | version | 10.5.9-MariaDB | | version_comment | Homebrew | | version_compile_machine | x86_64 | | version_compile_os | osx10.16 | | version_malloc_library | system | | version_source_revision | 3a8ca9096ea82ca61811450775511533d6cb1bb4 | | version_ssl_library | OpenSSL 1.1.1k 25 Mar 2021 | | wsrep_patch_version | wsrep_26.22 | +-----------------------------------+------------------------------------------+

Option 4: The STATUS Command

You can type STATUS any time you’re logged in to return information about the MariaDB version and other details.

mariadb Ver 15.1 Distrib 10.5.9-MariaDB, for osx10.16 (x86_64) using readline 5.1 Connection id: 11 Current database: PetHouse Current user: [email protected] SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server: MariaDB Server version: 10.5.9-MariaDB Homebrew Protocol version: 10 Connection: Localhost via UNIX socket Insert id: 4 Server characterset: utf8mb4 Db characterset: utf8mb4 Client characterset: utf8 Conn. characterset: utf8 UNIX socket: /tmp/mysql.sock Uptime: 7 days 23 hours 50 min 3 sec Threads: 1 Questions: 411 Slow queries: 0 Opens: 41 Open tables: 25 Queries per second avg: 0.000

Option 5: Login to MariaDB

When you first log in to MariaDB, the version number is presented within the “Welcome” message.

For example, opening a new terminal window and running the following command connects to MariaDB:

mariadb --auto-vertical-output

And the following “Welcome” (or similar) message is displayed:

Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 4 Server version: 10.5.9-MariaDB Homebrew Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Option 6: The —version Option

If you don’t have MariaDB open, you can find out what version it is by using the —version (or -V ) option of the mariadb , mariadb-admin , and mysqladmin programs.

Читайте также:  Изменение разрешения монитора linux

For example, opening a new terminal window and running the following command:

mariadb Ver 15.1 Distrib 10.5.9-MariaDB, for osx10.16 (x86_64) using readline 5.1

Running the following command:

mariadb-admin Ver 9.1 Distrib 10.5.9-MariaDB, for osx10.16 on x86_64

And running the following command:

mysqladmin Ver 9.1 Distrib 10.5.9-MariaDB, for osx10.16 on x86_64

The —version part can alternatively be shortened to just —V .

mariadb-admin Ver 9.1 Distrib 10.5.9-MariaDB, for osx10.16 on x86_64

Источник

Как проверить версию MySQL в Ubuntu Linux

Это краткое руководство показывает студентам и новым пользователям, как проверять версии MySQL/MariaDB в Ubuntu Linux.

Как узнать, какие версии MySQL или сервера базы данных MariaDB у вас установлены? Как узнать? Какую команду вы используете?

Ответ на все ваши вопросы подробно описан ниже.

В настоящее время, куда бы вы ни посмотрели, вы найдете сервер базы данных MariaDB, который используется во многих проектах с открытым исходным кодом. Несколько лет назад этого не было.

Тогда MySQL был, вероятно, единственным сервером баз данных, который использовался в большинстве проектов с открытым исходным кодом. Однако после изменений лицензирования, внесенных Oracle, новая материнская компания создала альтернативу MySQL под названием MariaDB.

MariaDB — это прямая замена MySQL. Это означает, что во многих случаях вы можете просто удалить MySQL и установить MariaDB, и все готово. Обычно нет необходимости конвертировать какие-либо файлы данных.

Какую бы базу данных вы ни использовали, приведенные ниже команды должны работать для определения версии MySQL или MariaDB.

Чтобы начать проверку версий базы данных MySQL или MariaDB, выполните следующие действия.

Проверить версию сервера MySQL

MySQL и MariaDB поставляются со встроенным инструментом, который позволяет вам проверять версии сервера. Просто запустите приведенные ниже команды с аргументом -d, чтобы отобразить текущую версию сервера.

Выполнение приведенной выше команды покажет, какая версия работает на сервере.

MySQL output: /usr/sbin/mysqld Ver 8.0.23-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)) MariaDB output: mysqld Ver 10.3.25-MariaDB-0ubuntu0.20.04.1 for debian-linux-gnu on x86_64 (Ubuntu 20.04)

Если вы запустите приведенные ниже команды, она также должна отобразить версию сервера.

MySQL output: mysqladmin Ver 8.0.23-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)) MariaDB output: mysqladmin Ver 9.1 Distrib 10.3.25-MariaDB, for debian-linux-gnu on x86_64

MySQL и MariaDB поставляются с клиентским инструментом, который также должен помочь вам найти версию сервера. Из командной строки вызовите клиентский инструмент, выполнив следующую команду:

Читайте также:  Чем изменить раздел линукс

Это позволит вам войти в систему и отобразить сведения о сервере, включая номер версии.

Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 9 Server version: 8.0.23-0ubuntu0.20.04.1 (Ubuntu) Copyright (c) 2000, 2021, 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>

Сервер MariaDB выдаст следующее сообщение:

Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 49 Server version: 10.3.25-MariaDB-0ubuntu0.20.04.1 Ubuntu 20.04 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>

Или запустите запрос STATUS, чтобы отобразить сведения о сервере, включая номер версии.

Это должно отобразить вывод ниже:

Connection id: 9 Current database: Current user: root@localhost SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 8.0.23-0ubuntu0.20.04.1 (Ubuntu) Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: utf8mb4 Db characterset: utf8mb4 Client characterset: utf8mb4 Conn. characterset: utf8mb4 UNIX socket: /var/run/mysqld/mysqld.sock Binary data as: Hexadecimal Uptime: 6 min 54 sec Threads: 2 Questions: 5 Slow queries: 0 Opens: 117 Flush tables: 3 Open tables: 36 Queries per second avg: 0.012

Этих методов немного, которые помогут вам определить серверную версию MySQL или MariaDB из консоли командной строки.

Использование phpMyAdmin

Если у вас установлен phpMyAdmin, вы также сможете увидеть версию сервера на портале. Войдите в систему и просмотрите сведения о сервере на панели управления.

Использование PHP

Если вы можете загрузить файл в корневой каталог Интернета, просто создайте локальный файл с именем mysqlversion.php . Затем скопируйте и вставьте приведенный ниже код в файл и загрузите его в корневую папку вашего сервера.

Это отобразит версию вашего сервера.

Могут быть другие способы просмотреть номер версии вашего сервера базы данных в Ubuntu Linux. Однако несколько вышеперечисленных методов должны помочь вам начать работу.

Заключение

В этом посте показано, как узнать номер версии сервера базы данных MySQL или MariaDB в Ubuntu Linux. Если вы обнаружите какую-либо ошибку выше, пожалуйста, используйте форму комментария ниже, чтобы сообщить.

Насколько публикация полезна?

Нажмите на звезду, чтобы оценить!

Средняя оценка / 5. Количество оценок:

Оценок пока нет. Поставьте оценку первым.

Источник

VERSION

Returns a string that indicates the MariaDB server version. The string uses the utf8 character set.

Examples

SELECT VERSION(); +----------------+ | VERSION() | +----------------+ | 10.4.7-MariaDB | +----------------+ 

The VERSION() string may have one or more of the following suffixes:

Suffix Description
-embedded The server is an embedded server (libmariadbd).
-log General logging, slow logging or binary (replication) logging is enabled.
-debug The server is compiled for debugging.
-valgrind The server is compiled to be instrumented with valgrind.
Читайте также:  Virtual driver for linux

Changing the Version String

Some old legacy code may break because they are parsing the VERSION string and expecting a MySQL string or a simple version string like Joomla til API17, see MDEV-7780.

One can fool these applications by setting the version string from the command line or the my.cnf files with —version=. .

Comments

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.

Источник

Check MariaDB Version

Whenever you install any database server or any other software for that matter on your system, you might want to know its installed version. This is done to ensure that you have the updated version of the target software or DBMS installed on your system. Moreover, it also enables you to install the other related packages correctly after knowing their compatibility with each other. Therefore, this is a quick tutorial to guide you on the method of checking the version of the MariaDB server installed in Ubuntu 22.04 system.

How to Check the Version of MariaDB in Ubuntu 22.04 System

Before proceeding with the method of checking the version of MariaDB in Ubuntu 22.04 system, you need to meet the following pre-requisite:

Pre-Requisite

For checking the version of MariaDB in Ubuntu 22.04 system in particular or any other operating system in general, you should have the MariaDB server installed in your target system.

Method

To check the version of the MariaDB server installed in your Ubuntu 22.04 system, you just need to run the following command in your terminal:

Once you run this command in your terminal, (provided that the MariaDB server is already installed on your system) you will instantly be able to see the version of MariaDB as shown in the following image:

Conclusion

This article is designed to show you the command with which you can easily check the version of MariaDB installed in your Ubuntu 22.04 system. Therefore, by following this quick tutorial, you can easily find out the version of MariaDB at any time you want.

About the author

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.

Источник

Оцените статью
Adblock
detector