Как использовать Adminer для управления базами данных
Что такое Adminer
Adminer — это легковесный инструмент для управления базами данных, который поддерживает различные системы баз данных, включая MySQL, MariaDB, PostgreSQL, SQLite и другие. В сравнении с другими инструментами управления базами данных, Adminer имеет следующие преимущества:
- Развертывание в одном файле: Для работы Adminer требуется всего один PHP файл, что значительно упрощает развертывание и использование.
- Поддержка нескольких баз данных: Adminer может управлять различными системами баз данных, делая его универсальным инструментом для разработчиков.
- Простой интерфейс: Adminer предлагает простой и интуитивно понятный пользовательский интерфейс, который помогает разработчикам легко выполнять различные операции с базами данных.
- Мощный функционал: Adminer поддерживает полный набор функций для управления базами данных, включая создание, изменение, удаление баз данных и таблиц, выполнение SQL-запросов, импорт и экспорт данных и многое другое.
Для разработчиков Adminer не только повышает производительность, но и упрощает сложность управления базами данных.
Доступ к Adminer
ServBay имеет встроенный Adminer, вы можете получить к нему доступ по следующему адресу: https://servbay.host/adminer.php
Использование Adminer для управления встроенной MariaDB (MySQL) базой данных в ServBay
Вход на сервер
- Откройте браузер и перейдите по адресу URL Adminer.
- На странице входа выберите тип базы данных “MySQL”.
- Введите данные для подключения к серверу:
- Имя пользователя и пароль можно найти в разделе «Настройки» – «База данных» в ServBay.
- Сервер:
localhost
или/Applications/ServBay/tmp/mysql.sock
- Нажмите кнопку «Войти», чтобы перейти к интерфейсу управления базой данных.
Создание базы данных
- После успешного входа нажмите на «Создать базу данных» в левом меню.
- Введите имя базы данных.
- Нажмите кнопку «Сохранить», чтобы создать базу данных.
Добавление данных
- Выберите недавно созданную базу данных.
- Нажмите на «Создать таблицу».
- Введите название таблицы и информацию о полях.
- Нажмите кнопку «Сохранить», чтобы создать таблицу.
- Выберите созданную таблицу и нажмите на «Вставить».
- Введите данные и нажмите кнопку «Сохранить».
Удаление данных
- Выберите таблицу, с которой нужно работать.
- Нажмите кнопку «Выбрать», выберите строки данных для удаления.
- Нажмите кнопку «Удалить», чтобы подтвердить удаление.
Удаление базы данных
- В списке баз данных выберите базу данных, которую нужно удалить.
- Нажмите кнопку «Удалить».
- Подтвердите удаление.
Использование Adminer для управления встроенной базой данных PostgreSQL в ServBay
Вход на сервер
- Откройте браузер и перейдите по адресу URL Adminer.
- На странице входа выберите тип базы данных “PostgreSQL”.
- Введите данные для подключения к серверу:
- Имя пользователя и пароль можно найти в разделе «Настройки» – «База данных» в ServBay.
- Сервер:
/Applications/ServBay/tmp
- База данных:
postgres
или другая база данных с правами на управление
- Нажмите кнопку «Войти», чтобы перейти к интерфейсу управления базой данных.
Создание базы данных
- После успешного входа нажмите на «Создать базу данных» в левом меню.
- Введите имя базы данных.
- Нажмите кнопку «Сохранить», чтобы создать базу данных.
Добавление данных
- Выберите недавно созданную базу данных.
- Нажмите на «Создать таблицу».
- Введите название таблицы и информацию о полях.
- Нажмите кнопку «Сохранить», чтобы создать таблицу.
- Выберите созданную таблицу и нажмите на «Вставить».
- Введите данные и нажмите кнопку «Сохранить».
Удаление данных
- Выберите таблицу, с которой нужно работать.
- Нажмите кнопку «Выбрать», выберите строки данных для удаления.
- Нажмите кнопку «Удалить», чтобы подтвердить удаление.
Удаление базы данных
- В списке баз данных выберите базу данных, которую нужно удалить.
- Нажмите кнопку «Удалить».
- Подтвердите удаление.
Использование Adminer для управления базой данных SQLite 3
Вход на сервер
- Откройте браузер и перейдите по адресу URL Adminer.
- На странице входа выберите тип базы данных “SQLite 3”.
- Введите путь к файлу базы данных: рекомендуется разместить файл DB в каталоге
/Applications/ServBay/db/sqlite
. - Нажмите кнопку «Войти», чтобы перейти к интерфейсу управления базой данных.
Создание базы данных
- Введите имя нового файла базы данных в поле пути к файлу базы данных.
- Нажмите кнопку «Сохранить», чтобы создать базу данных.
Добавление данных
- Выберите недавно созданную базу данных.
- Нажмите на «Создать таблицу».
- Введите название таблицы и информацию о полях.
- Нажмите кнопку «Сохранить», чтобы создать таблицу.
- Выберите созданную таблицу и нажмите на «Вставить».
- Введите данные и нажмите кнопку «Сохранить».
Удаление данных
- Выберите таблицу, с которой нужно работать.
- Нажмите кнопку «Выбрать», выберите строки данных для удаления.
- Нажмите кнопку «Удалить», чтобы подтвердить удаление.
Удаление базы данных
- В поле пути к файлу базы данных выберите файл базы данных, который нужно удалить.
- Удалите файл вручную или используйте инструмент управления файлами для удаления.
Следуя этим инструкциям, вы сможете легко управлять различными системами баз данных, встроенными в ServBay, с помощью Adminer. Простота интерфейса и мощный функционал Adminer значительно повысят вашу эффективность в управлении базами данных.