D
D
Dilik Pulatov2021-09-08 06:19:43
PHP
Dilik Pulatov, 2021-09-08 06:19:43

How to connect to a Mysql 5.3 database using php 5.6 or php 7.4?

There is an old project - Debian 3.2.68. Mysql 5.5.55 and Php 5.3
I need to connect to the database remotely and get the data.
The server with which I am connecting is Ubuntu 20.04, Php 7.4 (there is also version 5.6)
When connecting to the database, it gives an error

SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

I tried to change something in the old database but it didn't work
ALTER USER 'remote_user'@'%' IDENTIFIED WITH mysql_native_password BY 'mypassword';

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER USER 'remote_user'@'%' IDENTIFIED WITH mysql_native_password BY 'mypassword'' at line 1


And by the way, I connect to the old database through Jetbrains DataGrip without any problems.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
R
Rsa97, 2021-09-08
@Rsa97

It is best to create an additional user to connect from the new version of PHP.
https://dev.mysql.com/doc/refman/5.7/en/password-h...
In MySQL console:

SET @@SESSION.old_passwords = 0;
CREATE USER 'newuser'@'%' IDENTIFIED BY 'newpass';
GRANT SELECT, INSERT, UPDATE, DELETE ON `database`.* TO 'newuser'@'%';
FLUSH PRIVILEGES;

C
CheGevara, 2014-08-18
@CheGevara

With a budget of 30-40k, you go and take something on an Intel i7 and an NV video card.
In principle, all models are similar and powerful, there are already personal preferences.
A quick look at prices:
for example Asus www.dns-shop.ru/catalog/i194395/14-noutbuk-asus.html

G
Grag, 2014-08-18
@Grag

macbook

X
XaveScor, 2014-08-20
@XaveScor

Oddly enough, even ultrabooks suit you. For example? I get along well on lenovo yoga 13(core i3, 4GB). I work in IDEA and in Visual Studio for myself. Everything works great on small and medium projects.

E
Elena, 2014-08-20
@keeper81

I would take this one for myself from i7
market.yandex.ru/model.xml?modelid=10707568&hid=91013

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question