Como executar o cliente mysql

1

Eu uso o Ubuntu com o desktop xubuntu e eu instalei um servidor mysql e um cliente mysql usando terminal.

sudo apt-get install mysql-client
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.8.0-36 linux-headers-4.8.0-36-generic linux-headers-4.8.0-54 linux-headers-4.8.0-54-generic
  linux-image-4.8.0-36-generic linux-image-4.8.0-54-generic linux-image-extra-4.8.0-36-generic
  linux-image-extra-4.8.0-54-generic snap-confine
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  mysql-client
0 upgraded, 1 newly installed, 0 to remove and 46 not upgraded.
Need to get 10,0 kB of archives.
After this operation, 184 kB of additional disk space will be used.
Get:1 http://pl.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-client all 5.7.18-0ubuntu0.16.04.1 [10,0 kB]
Fetched 10,0 kB in 0s (24,9 kB/s) 
Selecting previously unselected package mysql-client.
(Reading database ... 315234 files and directories currently installed.)
Preparing to unpack .../mysql-client_5.7.18-0ubuntu0.16.04.1_all.deb ...
Unpacking mysql-client (5.7.18-0ubuntu0.16.04.1) ...
Setting up mysql-client (5.7.18-0ubuntu0.16.04.1) ...

E agora eu não sei como posso executar o cliente mysql e onde o cliente foi instalado.

    
por user 30.06.2017 / 11:16

1 resposta

2

Para verificar a versão do MySQL instalada, abra o terminal e digite:

mysql -V

O meu é a versão 5.7.18

mysql  Ver 14.14 Distrib 5.7.18, for Linux (x86_64) using  EditLine wrapper

Para usar o MySQL

Digite mysql -u username -p Em seguida, informe sua senha que você definiu ao instalar. O nome de usuário geralmente é root . Então comece a escrever comandos SQL.

Meu:

subroot@subroot:~$ mysql -u root -p
Enter password: ********

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

Copyright (c) 2000, 2017, 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> 
    
por Parto 30.06.2017 / 11:27