cloudControl mysqls.free import database - mysql

I am trying to import a SQL file into my mysqls.free addon on cloudControl. It is not working. Documentation says:
To import an sql file into a MySQL database use the following command.
$ mysql -u MYSQLS_USER -p --host=MYSQLS_SERVER --ssl-ca=PATH_TO_CERTIFICATE/mysql-ssl-ca-cert.pem MYSQLS_DATABASE < MYSQLS_HOSTNAME.sql
I was able to connect to the SQL server, but there it says: MYSQLS_HOSTNAME not MYSQLS_SERVER and MYSQLS_USERNAME not MYSQLS_USER.
Do I need to enter different credentials?
Gracias!

thank you for the hint in the documentation, as you mentioned, the MYSQLS_USER and MYSQLS_SERVER placeholder were wrong. It is fixed now https://www.cloudcontrol.com/dev-center/Add-on%20Documentation/Data%20Storage/MySQLs

Related

Restore db from sql file

I am tring import data from sql file using command line like this:
mysys-12: mysql -u root -p my_db_t < my_db_t_2022_10_12.sql
but I got:
mysql: [ERROR] unknown variable 'sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTIO
How can I import data? Should I add any params?
It seems that the content in the sql file conflicts with the constraint of sql_mode. There are two methods. The first method is to modify the content of the file to meet the constraint of sql_mode. The second method is to set SQL _ mode ='' in mysql. Then import the data and change it back.
Problem solved, I removed sql-mode from client configuration, file: etc/mysql/conf.d/mysql.cnf
Server configuration - No change

Value for 'configPath' when running checkForServerUpgrade on AWS RDS

To prepare my upgrade from mysql 5.7 to mysql 8, I want to run the upgrade utility checker. Here's what I did so far:
installed mysqlsh on my machine
started mysqlsh
executed util.checkForServerUpgrade targeting the server that I want to upgrade
Here's the exact command that I used in step 3:
util.checkForServerUpgrade('root#my-remote-host:3306', { "password":"my-password" })
This runs fine but some checks are not executed because I don't provide the configPath parameter. For example, here's a warning that I get:
14) Removed system variables for error logging to the system log configuration
To run this check requires full path to MySQL server configuration file to be specified at 'configPath' key of options dictionary
More information:
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-13.html#mysqld-8-0-13-logging
Anybody knows the value that I should provide for the configPath parameter?
I've tried to do the same using the command util.checkForServerUpgrade defining the configPath, without success. I then tried to run the same command directly from outside the mysqlsh shell, with success:
mysqlsh -- util check-for-server-upgrade root#localhost --target-version=8.0.13 --output-format=JSON --config-path=/etc/mysql/my.cnf
and it worked. To be noted that when I've tried to run from mysqlsh in the session root#localhost the command:
util.checkForServerUpgrade({"configPath":"/etc/mysql/my.cnf"})
mysqlsh replied with:
"Util.checkForServerUpgrade: Argument #1: Invalid values in connection options: configPath (ArgumentError)"
Try putting in the connection string, for example,
util.checkForServerUpgrade('root#localhost',{'configPath': '/etc/my.cnf'})
This worked for me, but without the connection string it doesn't.

Cant export data in MySqlbench

When i go Server>Data export>select my db>Export Progress>Start Export I got this error: mysqldump Version Mismatch
I have no idea how to proceed
Just found the solution, Open workbench, edit>preferences>administration> in Path to mysqldump Tool: i typed this: C:\wamp64\bin\mysql\mysql5.7.24\bin\mysqldump.exe and it worked fine.

Using Apache Drill

I am trying to use Apache Drill. The instructions at https://drill.apache.org/docs/drill-in-10-minutes/ seem to be very straightforward but after following them I get the following error:
show files;
Error: VALIDATION ERROR: SHOW FILES is supported in workspace type schema only. Schema [] is not a workspace schema.
Missing config for the path to files maybe?
Looks like you are issuing this command without connecting to any schema. You can issue this command after switching to particular schema using 'use '.Issue 'show schemas' to list available schemas.
If you are using sqlline, You may specify schema while connecting to sqlline as below (to connect schema 'dfs') .
sqlline -u "jdbc:drill:schema=dfs;zk=<zk node>:<zk port>"

Import MySQL DB Schema

I have successfully used mysqldump to export a db schema without data. I now want to import this db schema.
I have tried a couple of methods but come across the error related to the < character.
Any ideas?
As the error shows, input redirection in PowerShell does not work with the <sign. You would do it using the Cmdlet Get-Content and use piping to put the output into the input of the command:
Get-Content v:\mcsdb.sql | mysql -u root --sql --recreate-schema mcs
If you are interested in more in-depth info, refer to the Documentation.