I'm trying to get a site running locally that is currently running on a dev server running PHP 5.3.10. It connects to a MySQL server that is version 5.5, but has old_passwords set to ON.
The site works on the dev server.
On my local, I am running PHP 5.3.26 and when trying to connect I get:
Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: 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'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file
I understand that this is an issue with the old_password variable, but it is running on the dev server with PHP 5.3.
Edit:
Here's my local mysql section from phpinfo():
The dev server's mysql section:
How do I set up my local to match the dev server?
The PHP version is not the problem here, as of PHP 5.3 "old" MySQL passwords are not supported anymore. Probably two different permission profiles are applied. Are you connecting to the same server? Then something like this could be happening:
User Host
youruser % (using old-style password)
youruser localhost (using new-style password)
That you are using the same credentials does not necessarily mean that those are referring to the same account or permission profile.
Related
I recently installed Ubuntu 16.04.1 on a virtual machine ( i had problems with newer versions and Ldap) for testing.
I set up two way ssl authentication for my test website, mysql and phpmyadmin. So far so good.
I am able to loggin to phpmyadmin (i made a user and i can also login) by typing https://localhost/phpmyadmin but whenever i try to connect from a php to the database i get an access denied error for user 'myuser'#'localhost' (also tried with root) (using password yes).
Password and the php file i use to connect is not the problem. I tried them in Xampp on windows and i can connect. What am i doing wrong.
All the fixes i have seen so far are for when you are unable to login to phpmyadmin. But i can login. It's just when i try to use mysqli to connect from php it doesn't
Please share the code your using to connect to the database, from that we would be able to advise.
I have been trying to use Doctrine with Silex framework. I am using PHP 5.4. When I try to use database, I am getting the error:
An exception occured in driver: SQLSTATE[HY000] [2000] 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'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file
Unfortunately, I am on a shared hosting and I do not have access to the mysql database to apply the SET PASSWORD command and update my password. The hosting provider is also not willing to upgrade it.
I did check all the threads for the fix for this issue - but all of them ask me to run the SET SESSION and SET PASSWORD queries on the mysql database.
Is there any other way by which I can use Doctrine with the older authentication for MySQL?
Need basic help configuring Google App Engine SDK on a Windows 7 system to use a local install of MySQL. The GAE install is vanilla (GAE 1.8.8, Python 2.7.6, PHP 5.4), with MySQL 5.6.15 also installed. I am able to use the MySQL console, so MySQL is running. PHP is also running.
When I run a short PHP script consisting almost entirely of this line:
$dbconn = mysql_connect('localhost','root','rootpwd');
this is the error message I get:
Warning: mysql_connect(): No connection could be made because the target machine actively refused it.
My question: What settings do I need to add or change to allow my PHP scripts to connect to MySQL?
My root username and password are correct, as verified by my ability to access MySQL through the console. There are some difference between the GAE SDK setup and that of a WAMP server, which I also have installed on the same machine but which is not running now. Is there still likely to be a conflict between the freshly installed MySQL instance and the one on the WAMP server? Are there some environment variables (in Windows, in the SDK, or elsewhere) that I need to set?
I'm fairly sure this question has been asked before, but the answers I am seeing are either more complex than I can believe would be necessary, or simply gloss over the details of configuring the connection. Any help would be appreciated.
FIGURED IT OUT... Apparently my script was being pointed to the MySQL instance from the WAMP server, which was not running when I tried to connect in the script. As soon as I started that MySQL instance, the script connected to it.
So the moral of the story is... if you already have a MySQL instance installed outside of the GAE SDK, as long as that service is running your GAE PHP script will find it, and there's no need to install another MySQL instance just for the Google SDK.
You must allow external connection.
I don't know the path, but, apparently, the GAE connects to localhost not directly.
You can change the "localhost" by "127.0.0.1" to test it, or to "::1".
Some links to try change MySql external connections rules.
http://www.thegeekstuff.com/2010/08/allow-mysql-client-connection/
How to allow remote connection to mysql
I want to run a website on a server (actually only part of the server) I have a very limited access to. The only two things I can do is to connect via FTP to my part in the server and to connect to one MySQL database.
On this server I want to run some PHP code which uses PDO. The problem is that PDO is not enabled on this server.
So what can I do to have PDO on this server with the access I have?
Some more information on the server: It is a Windows server which runs Microsoft IIS 6.0. It has PHP 5.2.3.
If PDO isn't enabled (check <? phpinfo(); ?>) there's not much you can do... It can't be enabled without access to the PHP configuration on server level.
Did you mean: permissions?
When you connect the database with pdo, then you set the user. If in the phpmyadmin create the user with low permissions, then you can connect with this user in php pdo.
Example, if you created the user name of: readonly, and set readonly user password and permissions, then in connection you can use this user and password.
Sry for my english!
For a school project, I have installed MediaWiki on my local machine, and am required to have any database connection to the local MySQL database use SSL. I am unsure of how to connect all the dots. Here's what I have done so far:
I have installed OpenSSL, and created a self-signed certificate, and associated keys.
phpinfo() shows OpenSSL as being enabled.
I have included this in the [mysqld] section of my.ini:
ssl-key="C:/newcerts/server-key.pem"
ssl-cert="C:/newcerts/server-cert.pem"
ssl-ca="C:/newcerts/ca-cert.pem"
Running MySQL Command Line prompts me for the root password, and upon entering it, I get Error 1045:Access denied, etc.
Running mysql -u root -p ssl-ca="C:/newcerts/ca-cert.pem" from the bin directory and entering the password succeeds, and gives me a mysql prompt. Running status shows SSL: Cipher in use is DHE-RSA-AES256-SHA.
Here's where I'm confused. What else needs to be done (like through Apache or a PHP config file, or a MediaWiki file) to require database connections to use SSL?
You're going to want to use the mysqli extension because the native php/mysql extension does not support SSL. See the mysqli SSL related function:
http://us.php.net/manual/en/mysqli.ssl-set.php
That being said, the DB class in MediaWiki is abstracted out, but to the best of my knowledge the existing implemenation uses the regular php/mysql, NOT mysqli so I think you're going to have write your own mysqli adapter, or maybe somebody already has.
Either way you will need to get MediaWiki to use a mysqli adapter.