L
L
larka_skaz2018-02-11 20:49:10
PHP
larka_skaz, 2018-02-11 20:49:10

How to check MySQL version if you only have access to ftp and Wordpress console?

Let me explain - I want to use the Duplicator plugin to re-upload the finished site to local hosts so that I can work there without fear of ruining everything.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
C
cybernoob, 2018-02-11
@cybernoob

Place a php file via FTP with the phpinfo() command, open it through a browser, search for the mysql section in it, you will see something like: Client API version 5.5.52

A
AVKor, 2018-02-11
@AVKor

mysql> SELECT VERSION();
+-----------------+
| VERSION()       |
+-----------------+
| 5.6.30-1~bpo8+1 |
+-----------------+
1 row in set (0,01 sec)

A
Antonio Solo, 2018-02-11
@solotony

in the WP config you look at the parameters of the connection to the database

/** The name of the database for WordPress */
define('DB_NAME', 'assolo0k_clex');

/** MySQL database username */
define('DB_USER', 'assolo0k_clex');

/** MySQL database password */
define('DB_PASSWORD', '**************');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

then query the database using the method available to you SHOW VARIABLES LIKE "%version%
I do this from the
mysql command line -uassolo0k_clex -p********* -Dassolo0k_clex -e'SHOW VARIABLES LIKE "%version%";'
+-------------------------+---------------------------------+
| Variable_name           | Value                           |
+-------------------------+---------------------------------+
| innodb_version          | 5.7.20-19                       |
| protocol_version        | 10                              |
| slave_type_conversions  |                                 |
| tls_version             | TLSv1,TLSv1.1                   |
| version                 | 5.7.20-19-beget-5.7.20-20-1-log |
| version_comment         | (LTD BeGet)                     |
| version_compile_machine | x86_64                          |
| version_compile_os      | Linux                           |
+-------------------------+---------------------------------+

and you can write in PHP something like upload via FTP and execute via http
$con = mysql_connect('HOSTNAME','USERNAME','PASSWORD');
mysql_select_db('DATABASENAME', $con);
$query = "SHOW VARIABLES LIKE '%version%'";
$result = mysql_query($query);

you need to look not only at the version, but also at other variables - for example, utf8_mb4 support is relevant today, key length, if utf8_mb4 is supported

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question