Como usar o Adminer para gerenciar bancos de dados
O que é o Adminer
O Adminer é uma ferramenta leve de gerenciamento de banco de dados que suporta vários sistemas de bancos de dados, incluindo MySQL, MariaDB, PostgreSQL, SQLite, entre outros. Em comparação com outras ferramentas de gerenciamento de banco de dados, o Adminer possui as seguintes vantagens notáveis:
- Implantação de arquivo único: O Adminer requer apenas um arquivo PHP para ser executado, facilitando muito a implantação e o uso.
- Suporte a múltiplos bancos de dados: O Adminer pode gerenciar vários sistemas de bancos de dados, tornando-o uma ferramenta multifuncional para desenvolvedores.
- Interface simplificada: O Adminer oferece uma interface de usuário simples e intuitiva, ajudando os desenvolvedores a realizarem facilmente várias operações de banco de dados.
- Poderoso: O Adminer suporta funcionalidades completas de gerenciamento de bancos de dados, incluindo criação, modificação e exclusão de bancos de dados e tabelas, execução de consultas SQL, importação e exportação de dados, etc.
Para os desenvolvedores, o Adminer não apenas aumenta a eficiência do trabalho, mas também simplifica a complexidade do gerenciamento de bancos de dados.
Acessando o Adminer
O ServBay já vem com o Adminer, você pode acessar o Adminer através do seguinte endereço: https://servbay.host/adminer.php
Usando o Adminer para gerenciar o MariaDB (MySQL) do ServBay
Conectando ao servidor
- Abra o navegador e acesse a URL do Adminer.
- Na tela de login, escolha o tipo de banco de dados como "MySQL".
- Insira as informações de conexão do servidor:
- Nome de usuário e senha: você pode obter isso nas 'Configurações' - 'Banco de Dados' do ServBay.
- Servidor:
localhost
ou/Applications/ServBay/tmp/mysql.sock
- Clique no botão "Login" para entrar na interface de gerenciamento do banco de dados.
Criando um banco de dados
- Após o login com sucesso, clique em "Criar banco de dados" no menu à esquerda.
- Insira o nome do banco de dados.
- Clique no botão "Salvar" para criar o banco de dados.
Adicionando dados
- Selecione o banco de dados recém-criado.
- Clique em "Criar tabela".
- Insira o nome da tabela e as informações dos campos.
- Clique no botão "Salvar" para criar a tabela.
- Selecione a tabela criada e clique em "Inserir".
- Insira os dados e clique no botão "Salvar".
Excluindo dados
- Selecione a tabela a ser operada.
- Clique no botão "Selecionar" para escolher as linhas de dados a serem excluídas.
- Clique no botão "Excluir" para confirmar a exclusão.
Excluindo um banco de dados
- Na lista de bancos de dados, selecione o banco de dados a ser excluído.
- Clique no botão "Excluir".
- Confirme a exclusão.
Usando o Adminer para gerenciar o PostgreSQL do ServBay
Conectando ao servidor
- Abra o navegador e acesse a URL do Adminer.
- Na tela de login, escolha o tipo de banco de dados como "PostgreSQL".
- Insira as informações de conexão do servidor:
- Nome de usuário e senha: você pode obter isso nas 'Configurações' - 'Banco de Dados' do ServBay.
- Servidor:
/Applications/ServBay/tmp
- Banco de dados:
postgres
ou outro banco de dados com permissão de gerenciamento
- Clique no botão "Login" para entrar na interface de gerenciamento do banco de dados.
Criando um banco de dados
- Após o login com sucesso, clique em "Criar banco de dados" no menu à esquerda.
- Insira o nome do banco de dados.
- Clique no botão "Salvar" para criar o banco de dados.
Adicionando dados
- Selecione o banco de dados recém-criado.
- Clique em "Criar tabela".
- Insira o nome da tabela e as informações dos campos.
- Clique no botão "Salvar" para criar a tabela.
- Selecione a tabela criada e clique em "Inserir".
- Insira os dados e clique no botão "Salvar".
Excluindo dados
- Selecione a tabela a ser operada.
- Clique no botão "Selecionar" para escolher as linhas de dados a serem excluídas.
- Clique no botão "Excluir" para confirmar a exclusão.
Excluindo um banco de dados
- Na lista de bancos de dados, selecione o banco de dados a ser excluído.
- Clique no botão "Excluir".
- Confirme a exclusão.
Usando o Adminer para gerenciar bancos de dados SQLite 3
Conectando ao servidor
- Abra o navegador e acesse a URL do Adminer.
- Na tela de login, escolha o tipo de banco de dados como "SQLite 3".
- Insira o caminho do arquivo do banco de dados: recomenda-se colocar o arquivo DB no diretório
/Applications/ServBay/db/sqlite
. - Clique no botão "Login" para entrar na interface de gerenciamento do banco de dados.
Criando um banco de dados
- No caminho do arquivo do banco de dados, insira o nome do novo arquivo de banco de dados.
- Clique no botão "Salvar" para criar o banco de dados.
Adicionando dados
- Selecione o banco de dados recém-criado.
- Clique em "Criar tabela".
- Insira o nome da tabela e as informações dos campos.
- Clique no botão "Salvar" para criar a tabela.
- Selecione a tabela criada e clique em "Inserir".
- Insira os dados e clique no botão "Salvar".
Excluindo dados
- Selecione a tabela a ser operada.
- Clique no botão "Selecionar" para escolher as linhas de dados a serem excluídas.
- Clique no botão "Excluir" para confirmar a exclusão.
Excluindo um banco de dados
- No caminho do arquivo do banco de dados, selecione o arquivo de banco de dados a ser excluído.
- Exclua manualmente o arquivo ou use uma ferramenta de gerenciamento de arquivos para excluí-lo.
Seguindo os passos acima, você poderá usar facilmente o Adminer para gerenciar os vários sistemas de banco de dados incorporados no ServBay. A interface simples e os recursos poderosos do Adminer aumentarão significativamente sua eficiência no gerenciamento de bancos de dados.