Installa i pacchetti mysql,apache2,phpmyadmin


sudo -i
apt-get update
apt-get install mysql-server libmysqlclient20 phpmyadmin -y

Installa file per mcsql

wget -O /usr/local/bin/mcsql http://infosat.org/mcsql/files/mcsql
chmod +x /usr/local/bin/mcsql
wget -O /usr/local/bin/slave http://infosat.org/mcsql/files/slave
chmod +x /usr/local/bin/slave
mkdir /var/mcsql
cd /var/mcsql
wget http://infosat.org/mcsql/files/mcsql-data.tgz
tar -xzf mcsql-data.tgz

Aggiunge user Mysql con accesso root

mysql -u root -p
CREATE USER 'user'@'localhost' IDENTIFIED BY 'Pass';
GRANT ALL PRIVILEGES ON * . * TO 'user'@'localhost';
exit


Apre il file mcsql.cfg


nano /var/mcsql/mcsql.cfg


Editare il file salva e esci


MYSQL SERVER: localhost
MYSQL USERNAME: root
MYSQL PASSWORD: passrootmysql
MYSQL DATABASE: mcsql


avia slave e mcsql



slave port
mcsql (deve essere aperto come root)

Login phpmyadmin con user creato!!! root e bloccato
Login mcsql IP/HOST:Port





Per eliminare gli errori in phpmyadmin

sudo nano /usr/share/phpmyadmin/libraries/plugin_interface.lib.php
Ctrl+w
if ($options != null && count($options) > 0) {
cambia con
if ($options != null && count((array)$options) > 0) {
Ctrl+x
Y
sudo systemctl restart apache2


sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php
ctrl+W
(count($analyzed_sql_results['select_expr'] == 1)
cambia con
((count($analyzed_sql_results['select_expr']) == 1)
Ctrl+x
Y
sudo systemctl restart apache2


Sudo nano /usr/share/phpmyadmin/libraries/DisplayResults.php
ctrl+W

// Move to the next page or to the last one
$endpos = $_SESSION['tmpval']['pos']
+ $_SESSION['tmpval']['max_rows'];

if ($this->__get('unlim_num_rows') === false // view with unknown number of rows
|| ($endpos < $this->__get('unlim_num_rows')
&& $this->__get('num_rows') >= $_SESSION['tmpval']['max_rows']
&& $_SESSION['tmpval']['max_rows'] != self::ALL_ROWS)
) {

$table_navigation_html
.= $this->_getMoveForwardButtonsForTableNavigation(
$html_sql_query, $pos_next, $is_innodb
);

} // end move toward
cambia con

// Move to the next page or to the last one
if ($this->__get('unlim_num_rows') === false // view with unknown number of rows
|| ($_SESSION['tmpval']['max_rows'] != self::ALL_ROWS
&& $_SESSION['tmpval']['pos'] + $_SESSION['tmpval']['max_rows'] < $this->__get('unlim_num_rows')
&& $this->__get('num_rows') >= $_SESSION['tmpval']['max_rows'])
) {

$table_navigation_html
.= $this->_getMoveForwardButtonsForTableNavigation(
$html_sql_query, $pos_next, $is_innodb
);

} // end move toward

Ctrl+x
Y
sudo systemctl restart apache2