Português

Instalar o MySQL Server 5.6 no Ubuntu

Este tutorial irá mostrar em poucos passos, como instalar o MySQL Server 5.6 no Ubuntu.

Instalação

Execute o comando abaixo em seu terminal:

sudo apt-get install mysql-server-5.6

Pode ser sugerida a instalação de pacotes adicionais, digite y para confirmar:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18
  libterm-readkey-perl mysql-client-5.6 mysql-client-core-5.6 mysql-common
  mysql-common-5.6 mysql-server-core-5.6
Suggested packages:
  libclone-perl libmldbm-perl libnet-daemon-perl libplrpc-perl
  libsql-statement-perl libipc-sharedcache-perl mailx tinyca
The following NEW packages will be installed:
  libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18
  libterm-readkey-perl mysql-client-5.6 mysql-client-core-5.6 mysql-common
  mysql-common-5.6 mysql-server-5.6 mysql-server-core-5.6
0 upgraded, 12 newly installed, 0 to remove and 99 not upgraded.
Need to get 609 kB/21.5 MB of archives.
After this operation, 165 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

Em seguida, será solicitado que você defina uma senha para o usuário root:

Confirme sua senha:

Pronto! Depois de instalar o MySQL Server através dos passos acima, todas as configurações necessárias para inicializar automaticamente seu banco de dados na inicialização do sistema já foram definidas.

Testando seu Banco de Dados

Ainda no terminal, vamos nos conectar ao MySQL utilizando o usuário root e a senha que definimos nos passos anteriores:

mysql -u root -p
Enter password:

Então, a mensagem de boas vidas do MySQL Server será apresentanda a você:

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

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

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>

Vamos executar nossa primeira query para ter certeza de que tudo correu como esperado:

mysql> select version();
+-------------------------+
| version()               |
+-------------------------+
| 5.6.19-0ubuntu0.14.04.1 |
+-------------------------+
1 row in set (0.00 sec)

Espero que ajude. Até mais!

bgasparotto

Recent Posts

Python function decorator

This guide will show you how to create a Python function decorator with a few…

2 years ago

Got permission denied while trying to connect to the Docker daemon socket

This guide will show you how to fix the error Got permission denied while trying…

2 years ago

Python virtual environment on Intellij IDEA

This guide will show you how to create a Python virtual environment on Intellij IDEA…

2 years ago

Find and kill processes on Linux and Mac by port number

This tutorial will quickly show you how to to find and kill processes on Linux,…

2 years ago

Python: Relocation R_X86_64_PC32 against symbol can not be used when making a shared object Error

This guide shows a possible solution for Python error Relocation R_X86_64_PC32 against symbol can not…

2 years ago

Kubernetes useful commands

I condensed below a cheat sheet of Kubernetes useful commands. I will keep updating this…

2 years ago