Error on MySQL Data Import - mysql

I am trying to import to a schema in MySQL workbench but get the following error:
ERROR 2049 (HY000): Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)
I had a similar problem trying to connect originally to the schema and solved it by following the fixes in this post but I can't do this import still. I can now access the schema fine, but when I try to do the import it fails with this same error.

Its not a bug, if you use your user account password with old hashing algorithm. you can try with new account with new algorithm password by following step -
set session old_passwords = 'OFF';
create user 'test' IDENTIFIED BY 'TESTPASS';
Now you can connect with this account and try to import. I hope it will help to you.

Related

How do I add MySQL database to icCube?

I am new to icCube and I need to add MySQL database as a data source. But every time I try to do it, icCube fails to establish connection:
Failed to establish the connection due to the error: JDBC connection for url 'jdbc:mysql://localhost:3306/foodmart' and user 'root' cannot be created due to error 'Could not create connection to database server.'
I am pretty sure I'm making a very dumb mistake, but as I mentioned before, I'm new and cannot figure it out. Here are the screenshots of
what I type in and my MySQL connection

CAS not connected to Mysql for user authentication

I'm new to CAS.
I like to authenticate user to the list of users inside the Mysql database. I have included this line of code in the build.gradle file
implementation "org.apereo.cas:cas-server-support-jdbc:${project.'cas.version'}"
Here is the table defination in Mysql.
I have setup an instance of CAS 6.4 in Ubuntu server, disabled static user authentication and configure the /etc/cas/config/cas.properties to use Mysql as data source for authentication as config below, all other settings leave as default:
server.name=https://id.example.com
server.prefix=${cas.server.name}/
server.context-path=/ server.port=443
server.ssl.key-store=file:/etc/cas/theKeystore
server.ssl.key-store-password=theKeystorePassword
server.ssl.key-password=thePassword
logging.config=file:/etc/cas/config/log4j2.xml
cas.authn.accept.enabled=false
cas.authn.jdbc.query[0].driver-class: com.mysql.jdbc.Driver
cas.authn.jdbc.query[0].field-password: password
cas.authn.jdbc.query[0].password: theDBPassword
cas.authn.jdbc.query[0].sql: SELECT * FROM users WHRE uid=?
cas.authn.jdbc.query[0].url: jdbc:mysql://localhost:3306/cas?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
cas.authn.jdbc.query[0].user: theDBUser
I have set global general_log on Mysql to ON to trace any connection attempt. However, it seems the CAS server never try to connect to the Mysql server. On user site, they simply received attempt failed message on login page.
Is there anything I've missed?
It seems that instead of using
com.mysql.jdbc.Driver
I need to use
com.mysql.cs.jdbc.Driver
as driver-class.

RMySQL error connecting to Mysql Database

I'm starting learning to use MySQL and, more specifically, I'm trying to learn how to connect and make it interact with Access and R.
I recently create an odbc connecting Access to R. I successfully used R libraries to retrieve it and use sql queries. So I moved to R + Mysql.
Here starts my problem!
After installing RODBC I installed RMySQL and tried to use "dbConnect". Here follows my code:
con <- dbConnect(dbDriver("MySQL"), user = "root", password = "mypwd", dbname = "mydbname")
where "mypwd" it's the password I inserted when created my MySQL ODBC Unicode Driver and "mydbname" it's the database name I connected. Just for sake of information, I already tested this odbc by transfering tables from Access and Mysql. So my doubts are related only to connection between Mysql and R.
So, let's see my error when running the code line above:
Error in .local(drv, ...) :
Failed to connect to database: Error: Plugin caching_sha2_password could not be loaded
I already read other posts about the need to change the Preferred Authentication Plugin.
I found this line code as solution:
ALTER USER user
IDENTIFIED WITH mysql_native_password
BY 'password';
So....please, tell me if I should change this code line into:
ALTER USER root
IDENTIFIED WITH mysql_native_password
BY 'mypwd';
Is it correct? Or I completely missed the point.
Sorry for my question but as I said, I'm a completely newbie. Thanks for your patience
Where is your host address ?
Try the code something like this
con <- dbConnect(dbDriver("MySQL"), host="192.100.XX.XX",db="df", user="root", password="mypwd")
Ok it seems I found out a workaround for my problem.
Instead of using "dbConnect" I used "odbcConnect". Here follows my working code:
channel <- odbcConnect("Myodbcname", uid="root")
df <- sqlQuery(channel, "SELECT * from mytable", as.is = TRUE)
"Myodbcname" is the name I saved for my DSN Name and DSN System.
So, now I can use my sql queries on my table and work on it.
At this point I need to understand the difference between the function "odbcConnect" and "dbConnect". Because if I don't need the latter I can ignore for the moment. Maybe I have to open a new thread with a link to this one. Not sure what Stackoverflow prefers me to do.

JDBC: DriverManager.getConnection(url) not reading user/password

I'm trying to open a connection to a db via the DriverManager. When I use the getConnection(url, properties) function it works fine, however when I try to append the username and password (something like jdbc:mysql:address;user=user;password=password) to the url and call getConnection(url) I get the following error
Access denied for user ''#'localhost' to database 'db_aux_linux64_mysql;user=user;password=password'
So while it was able to find the db, it is trying to pass in an empty string as the user argument (and probably the password as well) for some reason. Any ideas on why this might be?
You're using the wrong url syntax, try this:
Connection conn = DriverManager.getConnection("jdbc:mysql://hostname/dbname?user=user&password=password");
Note: Don't forget to add your database name after your hostname -- the error message you are getting is indicating that the jdbc driver is looking for a database that is literally named "db_aux_linux64_mysql;user=user;password=password".
Alternatively, you can just use the DriverManager.getConnection(url, uname, pass) as suggested in the comments, then you don't need to remember the url syntax for your jdbc driver (and your code will be more portable since each jdbc driver is subject to having different url syntax).
Source: Mysql doc seciton 6.1

Windows client for MySQL 4.1

Today i find myself administrating a 2003 MySQL database, does anyone know a Windows Client for MySQL 4.1?
I tried Workbench, DbVisualizer and DBeaver.
The problem mainly is from the auth, somewhere around version 4, MySQL changed the auth method, and the new clients no longer support that kind of connection.
Workbench in particular has an "use old authentication method" as a advanced option, but it seems that it's not enough.
I tried console connection and works just fine, but they are simply to many data and to many work to do to use only console (and the DDBB it's too big as well).
Before checking the "use old auth.." the error message was:
Error connecting to datasource "MySQL - DDBB"
SQL Error [1044] [42000]: Access denied for user 'user'#'%' to database 'information_schema'
Access denied for user 'user'#'%' to database 'information_schema'
Which make sense since the information schema table does not exists in that MySQL version (so i been told)
After checking and using the old auth method, the error is:
Your connection attemp failed for user 'user' from your host to server at ...... MySQL version is older than 5.0, which is not supported.
Anyone has an old client or the possiblity to bypass the old auth and work with a visual client for MySQL 4.1?
Heidi SQL worked just fine.
Also, you can try http://downloads.mysql.com/archives/workbench/
Problem solved.
You might also be able to connect in DBeaver using the MariahDB drivers which have the authentication method built in.