2
respostas

Após digitar create database petshop aparece uma ->

Após esse comando => mysql -u root -p Digitar a senha E digitar create database petshop Fica com uma seta ( -> ) conforme a abaixo:

$ mysql -u root -p Enter password: * Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 14 Server version: 8.0.27 MySQL Community Server - GPL

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> create database petshop -> *

2 respostas

Bom dia, Amós. Cara, acho que você se esqueceu do ";" no final do seu comando. Na sintaxe SQL é necessário usar o delimitador ";" para marcar o final de uma linha.

Tente executar create database petshop; com ; no final

Se acontecer isso novamente não tem problema, você pode digitar somente o ; e apertar enter. No meu fica mais ou menos assim:

root@fb5eeb4ecb06:/# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.35 MySQL Community Server (GPL)

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> create database newdb
    -> ;
Query OK, 1 row affected (0.00 sec)

mysql> 

Ou você também pode usar o \c e enter para apagar tudo que digitou:

mysql> create database new
    -> \c
mysql> 

o problema continua?

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software