Prisma gives error: in connector bad handshake - mysql

I have a remote MySQL server which I can connect to via my command line.
But when I try to run npx prisma db pull
it gives me this error:
Error: Error in connector: Error querying the database: Error querying the database: Error querying the database: Server error: ERROR 08S01 (1043): Bad handshake'
What did I do
My prisma database url is: mysql://sven:<URL-ENCODEDPASSWORD>#<IP-ADDRESS>3306/portfolio?sslidentity=client-identity.p12&sslpassword=<SSL-PASSORD>&sslcert=ca.pem
I copied the ssl certificate and keys like this, I made sure I copied it right.
:
sudo cat /var/lib/mysql/client-key.pem
sudo cat /var/lib/mysql/client-cert.pem
sudo cat /var/lib/mysql/ca.pem
following the documention I made the one sslindentiy of it.
When connecting from my command line I do this with the following command: mysql -usven -h<ip-address> -p
Does anyone have an idea how to fix this issue?

Related

mysql shell getting killed on Mac when executing mysql 8 datastore commands

I'm trying to explore MySQL 8 datastore. After opening MySQL shell and connecting to the sample database provided by MySQL here, world_x, when I run the query to list collections, I get the following error:
zsh: killed mysqlsh --mysqlx -u root -h localhost -P 33060
When I type db., intellisense is listing all the available collections and datastore functions as seen in the screenshot.
How can I proceed here?

2002 Code Error When Trying Import / Export MariaDB Databases in Bitnami's WordPress Multi-tier Stack

I'm trying to do database management via SSH for Bitnami's WordPress Multi-tier Stack/ Specifically I want to export and do an initial import (though I will probably just create a new database).
When I run the following commands, I get the following errors:
Command: mysqldump -u root -p bitnami_wordpress > bitnami_wordpress.sql
Output: mysqldump: Got error: 2002: "Can't connect to local MySQL server through socket '/opt/bitnami/mariadb/tmp/mysql.sock' (2)" when trying to connect
This also creates an 0B SQL file in my home directory.
Command: mysqladmin -u root -p status (I enter my password)
Output:
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket .
'/opt/bitnami/mariadb/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket:
'/opt/bitnami/mariadb/tmp/mysql.sock' exists!
Command: cd /opt/bitnami/mariadb/ + ls
Output:
bin CREDITS include licenses README-wsrep
COPYING data INSTALL-BINARY plugin sbin
COPYING.thirdparty EXCEPTIONS-CLIENT lib README.md share
Command: sudo find . -name mysql
Output:
./root/.nami/components/com.bitnami.mysql-client/lib/databases/mysql
./root/.nami/components/com.bitnami.mysql-client/lib/handlers/databases/mysql
./root/.nami/components/com.bitnami.libphp/lib/databases/mysql
./root/.nami/components/com.bitnami.libphp/lib/handlers/databases/mysql
./root/.nami/components/com.bitnami.wordpress/lib/databases/mysql
./root/.nami/components/com.bitnami.wordpress/lib/handlers/databases/mysql
./root/.nami/components/com.bitnami.php/lib/databases/mysql
./root/.nami/components/com.bitnami.php/lib/handlers/databases/mysql
./root/.nami/components/com.bitnami.apache/lib/databases/mysql
./root/.nami/components/com.bitnami.apache/lib/handlers/databases/mysql
./root/.nami/components/com.bitnami.mariadb/lib/databases/mysql
./root/.nami/components/com.bitnami.mariadb/lib/handlers/databases/mysql
./opt/bitnami/mysql
./opt/bitnami/mysql/bin/mysql
./opt/bitnami/mariadb/include/mysql
./opt/bitnami/mariadb/include/mysql/server/mysql
./opt/bitnami/mariadb/include/mysql/mysql
./opt/bitnami/mariadb/bin/mysql
./usr/share/bash-completion/completions/mysql
Commands:
find /opt/bitnami/mysql/ -name "*.cnf"
Output: Nothing
find /opt/bitnami/mariadb/ -name "my.cnf"
Output:
/opt/bitnami/mariadb/share/my-medium.cnf
/opt/bitnami/mariadb/share/my-small.cnf
/opt/bitnami/mariadb/share/my-large.cnf
/opt/bitnami/mariadb/share/my-innodb-heavy-4G.cnf
/opt/bitnami/mariadb/share/my-huge.cnf
/opt/bitnami/mariadb/share/wsrep.cnf
Command: nano /opt/bitnami/mariadb/share/my-medium.cnf (what's the difference between my-medium, my-small, and my-large)?
Output:
# The following options will be passed to all MariaDB clients
[client]
#password = your_password
port = 3306
socket = /opt/bitnami/mariadb/tmp/mysql.sock
NOTE: /opt/bitnami/mariadb/tmp/mysql.sock does not exist.
I've poked around a bit and came across MariaDB's Documentation about 2002 errors, but I don't seem to have the same .conf file (nor do I know where to look)
...from here I have no idea where to go, I've only done limited database management via shell.
Concise questions:
How do I export my database without getting the 2002 error?
How do I overwrite / update my database?
Any help would be much appreciated and thanks in advance!
The folks at Bitnami came through. I was connecting to the wrong host.
Find the host:
sudo cat /opt/bitnami/wordpress/wp-config.php | grep 'DB_HOST'
To export:
mysqldump -h provisioner-peer -u root -p bitnami_wordpress > bitnami_wordpress.sql

download from command line in Ubuntu

I'm trying to get a file from Mysql webpage from command line Ubuntu:
wget "http://dev.mysql.com/get/mysql-apt-config_0.8.3-1_all.deb"
But I'm getting error:
--2017-10-09 15:22:23-- http://dev.mysql.com/get/mysql-apt-config_0.8.3-1_all.deb
Resolving dev.mysql.com (dev.mysql.com)... 137.254.60.11
Connecting to dev.mysql.com (dev.mysql.com)|137.254.60.11|:80... failed: Connection refused.
What is the reason for this connection refuse error ?

Maria DB: MySQL Server has gone away, nothing in error log

I'm trying to slurp a database dump into a new database on my server, and I keep getting the following error
ERROR 2006 (HY000) at line 215: MySQL server has gone away
I've tried setting max_allowed_packet=16M in /etc/my.cnf
And editing the command directly: mysql -u my_db_user -p --max_allowed_packet=1073741824 my_db < my_db.sql
I still get this error. It doesn't create an error message in the log file, either. I'm running a mariadb fork of mysql (mysql 15.1, mariadb 5.5.52), CentOs version 7.3.1611.
Not sure what to do at this point!
Try setting max_allowed_packet=2G in my.cnf.

mysql upgrade (5.0.45 to 5.1.42) error

I am getting following error when we are upgrading 5.0.45 to 5.1.42. Do I need to use mysql_upgrade
or mysqlcheck ?
Caused by: java.sql.SQLException: Column count of mysql.proc is wrong. Expected 20, found 16. Created with MySQL 50045, now running 50142. Please use mysql_upgrade to fix this error.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1761)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2046)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1964)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1949)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:792)
at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:1)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)
If you're running on a XAMPP setup on ubuntu, navigate to:
/opt/lampp/bin
Then run
./mysql_upgrade
It should run a check through all your existing databases, at the end it may give you this error message:
Could not create the upgrade info file
'/opt/lampp/var/mysql/mysql_upgrade_info' in the MariaDB Servers
datadir, errno: 13
Not to worry, you can now import your db.sql script without errors.
In case you want to access your MariaDB shell, from the same location:
If you haven't set up a password:
./mysql -u root
If you've set up a password:
./mysql -u root -p
in mysql 5.1 4 additional columns were added for procedures. Seems that somehow your upgrade skipped that step and now you are getting error while importing data.
MySQL upgrade should help you solve that problem.
The exception indicates you should use mysql_upgrade.