How to enable/disable SSL for Prestashop via MySQL command line

Enter your database

mysql your_database;

Check the value

select * from ps_configuration where name like '%SSL_ENABLED%';

To enable

update ps_configuration set value = '1' where name = 'PS_SSL_ENABLED';
update ps_configuration set value = '1' where name = 'PS_SSL_ENABLED_EVERYWHERE';

To disable

update ps_configuration set value = '0' where name = 'PS_SSL_ENABLED';
update ps_configuration set value = '0' where name = 'PS_SSL_ENABLED_EVERYWHERE';

 … Read the rest

How to run shell commands from the inside MySQL command line

You need to use \! before shell command

Examples:

MariaDB [(none)]> \! date;
Sun Sep  9 03:18:38 CEST 2018
MariaDB [(none)]> \! ls -d public_html;
public_html
MariaDB [(none)]> \! touch 1.txt
MariaDB [(none)]> \! ls 1.txt
1.txt
MariaDB [(none)]> \! uptime;
 03:19:40 up 8 days, 11:45,  8 users,  load average: 4.92, 5.07, 4.89
MariaDB [(none)]> 
Read the rest

How to find WordPress admin users over mysql command line

How to show WordPress admin user using mysql command prompt

select * from wp_users u INNER JOIN wp_usermeta m ON m.user_id = u.ID where meta_value like '%administrator%';

or

SELECT u.ID, u.user_login, u.user_nicename, u.user_email FROM wp_users u INNER JOIN wp_usermeta m ON m.user_id
Read the rest

How to fix RoundCube’s error: DATABASE ERROR: CONNECTION FAILED!

Mysql server and InnoDB engine must to be running!

Check mysql connection:

cat /usr/local/cpanel/base/3rdparty/roundcube/config/config.inc.php |grep mysql:
$config['db_dsnw'] = 'mysql://roundcube:lasMubMX08D3HKtr@unix(/var/lib/mysql/mysql.sock)/roundcube';
mysql -u roundcube -p
show tables;

All tables should be in place:

+---------------------+
| Tables_in_roundcube |
+---------------------+
| cache               |
| cache_index         |
| cache_messages      |
| cache_shared        |
| cache_thread        |
| contactgroupmembers |
| contactgroups       |
| contacts            |
| cp_schema_version   |
| dictionary          |
| identities          |
| searches            |
| session             |
| system              |
| users               |
+---------------------+
15 rows in set (0.00 sec)

Cpanel keeps roundcube backups here:

/var/cpanel/roundcube

Go ahead and drop broken database

mysqladmin drop roundcube

Rebuild roundcube using the following two commands:

rpm -e --nodeps cpanel-roundcubemail

/usr/local/cpanel/scripts/check_cpanel_rpms --fix

Database roundcube should be recreated automatically.
Read the rest

How to show a real multisite WordPress super admin users via MySQL command line

For multisite WordPress version run the following commands:

mysql
use database_name;
SELECT * FROM wp_sitemeta where meta_key='site_admins';

This will also allow you to know which users can access plugins for management… Read the rest