Solucionado (ver solução)
Solucionado
(ver solução)
5
respostas

[Bug] Impossivel de criar a tabel. mysql: command not found

Ola,

Meu projeto esta todo configurado como na aula. Mas nao sei como resolver este problema ja que eu uso MySQL com outros projetos em Laravel/Mamp. Talvez eu precise fazer uma outra configuracao para acessar a DB no meu Mac ?

'... screenmatch % mysql -u root -p screenmatch '

5 respostas

quando rodo o projeto =

... 2023-06-20T18:54:56.601+02:00 ERROR 26038 --- [ restartedMain] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization. com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:175) ~[mysql-connector-j-8.0.33.jar:8.0.33] Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[na:na] at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na] at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[na:na] at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[na:na] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:62) ~[mysql-connector-j-8.0.33.jar:8.0.33] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-j-8.0.33.jar:8.0.33] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:150) ~[mysql-connector-j-8.0.33.jar:8.0.33] at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:166) ~[mysql-connector-j-8.0.33.jar:8.0.33] at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89) ~[mysql-connector-j-8.0.33.jar:8.0.33] at com.mysql.cj.NativeSession.connect(NativeSession.java:121) ~[mysql-connector-j-8.0.33.jar:8.0.33] at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:945) ~[mysql-connector-j-8.0.33.jar:8.0.33] at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:815) ~[mysql-connector-j-8.0.33.jar:8.0.33] ... 53 common frames omitted Caused by: java.net.ConnectException: Connection refused

Caused by: org.hibernate.HibernateException: Unable to determine Dialect without JDBC metadata (please set 'javax.persistence.jdbc.url', 'hibernate.connection.url', or 'hibernate.dialect') at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:147) ~[hibernate-core-6.1.7.Final.jar:6.1.7.Final]

Eu ativei MAMP e o erro mudou : java.sql.SQLSyntaxErrorException: Table 'screenmatch.movies' doesn't exist at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:121) ~[mysql-connector-j-8.0.33.jar:8.0.33]

Mas no terminal, continua aparecendo : moemendes@Air-de-Moe screenmatch % mysql -u root -p screenmatch zsh: command not found: mysql

solução!

Oi!

Como você não instalou diretamente o MySQL no seu computador, mas sim via MAMP, precisa rodar esse comando no terminal:

sudo ln -s /Applications/MAMP/Library/bin/mysql /usr/local/bin/mysql

Após isso deve funcionar no terminal o comando mysql -u root -p screenmatch

Funcionou. Tem que mudar o path é isso ? Muito obrigada!

Foi criado um link simbólico no sistema operacional que aponta para o MySQL do MAMP.

Bons estudos!