Using old MYSQL passwords with php 5.3 - mysql

I have a problem where I am trying to connect to old database with new php5 and getting
mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password').
Everyone appears to solve this problem through making changes to either database config file or rehashing their passwords.
Catch is, I cannot do either at the moment. I would like to know if there is a way to make php5 use old passwords.

Given your constraint, your only option is to recompile PHP against the libmysqlclient library (instead of the default, native PHP mysqlnd). Try the "Linux-Generic" "Development Libraries" binaries provided by MySQL.
You might need to use an older version of libmysqlclient, I am not sure the newer versions still support the old authentication method.

Related

How do I disable the SSL requirement in MySQL Workbench?

It seems that an SSL connection is required to use MySQL Workbench, and I don't think this is the case with previous versions.
I remember SSL connections used to be optional. After I updated it, all options are locked to require SSL.
How do I bypass this? I'm just a student and setting up SSL is out of my reach.
Screenshot:
Here is the correct solution for version +8.0.x.
When the program starts, the edited configuration files are changed again.
Therefore, you need to add useSSL=1 in advanced.
I solved this by editing the connections.xml configuration file.
Under ~/.mysql/workbench/connections.xml, I searched for the connection name and changed
<value type="int" key="useSSL">2</value>
to
<value type="int" key="useSSL">1</value>
MySQL Workbench has released 8.0.28
It solves this bug. Wow. I am happy.
In Mac OS X there is this issue.
My version is mysql-workbench-community-8.0.27-macos-x86_64.dmg.
I have downgraded to mysql-workbench-community-8.0.26-macos-x86_64.dmg, and it has solved it.
This issue has been reported to the MySQL team. See Test Connection in Workbench fails since SSL required (Bug #105327).
In the bug report, the development team replies that this issue will be fixed in 8.0.28.
Someone may be waiting for the fix, but check for the newest version on the download page.
I found this solution on Stack Exchange and worked for me just fine on Windows 10. This is the original post: MySQL Workbench: "ssl is required but the server doesn't support it".
Look for the fehrlich's answer. I will describe it here as in the original post:
You can bring back the old SSL options in 8.0.27:
Close MySQL Workbench
Go to you MySQL Workbench install folder (p.e. C:\Program Files\MySQL\MySQL Workbench 8.0 CE)
open the file modules/data/mysql_rdbms_info.xml
replace all occurrences of
">2|Require,3|Require and Verify CA,4|Require and Verify Identity"
with ">0|No,1|If available,2|Require,3|Require and Verify CA,4|Require
and Verify Identity"
Now you have the old options back.
Original image
I don't know if it may be the right approach for you, but I downgraded my version of MySQL Workbench to 6.3 and uninstalled the previous version. It will then give you the "if available" option for SSL. As you are right, it is not the case for previous versions, however you do lose a few more modern features in the process.
MySQL Product Archives
Another solution as well is to connect to connect to the database in 6.3 and since the configuration saves are in the same location, upgrade to 8.0 where it will still have the old configuration file and won't use SSL due to backwards compatibility.
I am using MySQL server 5.6. Uninstall and install MySQL Workbench 8. It's working.
I encountered this error when I was trying to export or import database from AWS RDS. I had Mysql Workbench on my system and also had Mysql installed locally.
As none of the solution mentioned here worked for me, I went further to investigate the error. I found out that the Workbench Default Target Mysql is 8.0.15 and my natively installed version of Mysql was 5.7.24, meaning the Mysqldump tool I was using didn't support the SSL protocol.
I bumped the natively installed Mysql to 8.0.18, and pointed the dump tool to it and it worked as expected.
Hope this helps someone too.

Access MySql with HeidiSql

I do project and I use MySql. I like HeidiSql interface and generally this, so I would like to connect to my local database. But I really feel and maybe I am dumb because whatever host name I put I have errors. Anyway when I type ##hostname in cmd I see my windows authentication username, which also does not work for me.
Mysql Workbench work properly...
Default authentication plugin for MySQL has been changed in recent versions. Not all client programs out there have added support for it yet. You can check if HeidiSQL has released any latest version which adds this support. If it is not, then only solution is to change default authentication plugin on MySQL server and recreate the user. It is described in below links.
https://www.heidisql.com/forum.php?t=24939
https://github.com/HeidiSQL/HeidiSQL/issues/163

setup mysql for wordpress manually

I installed mysql and apache. Apache is serving wordpress correctly and I want to install wordpress via install.php. This fails at setup step 2 after inserting database name, user and password (error 500).
I suspect that I haven't correctly finished the mysql database setup.
So to check, I log in to mysql via mysql -u root -p and run select database(); which returns null. So there is no database. Then when I call create database wordpress it says the db already exists. So what??
Just in case someone asks why not use xampp or wamp or the like: I want to set up everything by hand to learn the basics.
System setup: Windows 8.1 64 bit, mysql 5.7.21, apache 2.4, php 7.2.4 w/ thread safe
In the php.ini file you have to enable two settings:
extension = mysqli
extension_dir = "ext"
The root cause was that I had only activated the extension setting.
The website where I found this tip did not mention the requirement to also set the extension directory.
The final solution is from the official guide to install mysqli, which is very misleading in this regard:
For PHP > 5.3 it says
On Windows, for PHP versions 5.3 and newer, the mysqli extension is
enabled and uses the MySQL Native Driver by default. This means you
don't need to worry about configuring access to libmysql.dll.
But this was not true for me. It did not work out of the box.
For older versions (e.g. ones which should not affect my version) it says
As with enabling any PHP extension (such as php_mysqli.dll), the PHP
directive extension_dir should be set to the directory where the PHP
extensions are located. See also the Manual Windows Installation
Instructions. An example extension_dir value for PHP 5 is c:\php\ext.
This was the final hint that got it working.

MAMP 3.1 and MySQL PDO

I just grabbed the latest version of MAMP Pro (3.1) and installed it only to find that it removes MySQL PDO entirely. That's a problem since the framework I'm using requires PDO to connect to the database. I tried grabbing the extensions from the old version of MAMP, but it immediately throws errors.
How do I get MySQL PDO back for MAMP 3.1? I've looked on the site and can't find a downloads page to roll back to the older version.
In MAMP 3.1, they've made the switch to mysqlnd which actually includes mysql, mysqli, and PDO. The problem is that they've removed all the PDO settings in php.ini because they aren't using the MySQL PDO extension. Because of this change, from the command line, PHP is looking at the wrong MySQL socket file. To fix this, I updated the php.ini file with the following line:
pdo_mysql.default_socket = /Applications/MAMP/tmp/mysql/mysql.sock
After that, everything started working again.
If anyone from Appsolute sees this, PLEASE re-add the PDO settings to the INI files so this sort of thing doesn't happen!

mysql5-client connects to mysql4-server

I installed mysql-5.1 into my server and mysql-4.1 has been installed already.
Then, I realized that I can connect from mysql-5.1 client to mysql-4.1 server like this.
[hoge#localhost:/usr/local/mysql5/bin]% ./mysql -u root -pXXXXXX -P 3306 -S /tmp/mysql4.sock
I can use select query to mysql-4.1 server. Is there any restriction in this case?
If there is a official document, please tell me.....
mysql5 has a perfect backward compatibility?
The one thing you have to worry about is what you're using to access your MySQL 4.1 database. When using PHP 5.3.0 with MySQL on the Microsoft Windows platform, I've hit a connection issue relating to the difference in password hashing between 4.1 and 5.1. See the official docs from MySQL on password hashing.
It's not fully backwards compatible. Read this document for the changes, in particular the ones marked Incompatible change.
Simple queries may work fine, but is much better to use the correct client for the server version (this goes double if you are accessing the server programmatically)