5/16/2019

Azure Mysql in app, error #2002



In the Azure WEB APP , MYSQL IN APP, you get this error
azurewebsites.net/phpMyAdmin/
Erreur :
#2002 - An attempt was made to access a socket in a way forbidden by its access permissions.
— The server is not responding (or the local server's socket is not correctly configured).
mysqli_real_connect(): (HY000/2002): An attempt was made to access a socket in a way forbidden by its access permissions. 


The solution is

5/09/2019

Got error 1 from storage engine


Using in the Azure Database for MySQL server


Got the error 1  when I tried to migrate the database


ERROR 1030 (HY000) at line   Got error 1 from storage engine


Why?
https://blogs.msdn.microsoft.com/azuresqldbsupport/2017/06/08/azure-database-for-mysql-cant-restore-database-with-error-got-error-1-from-storage-engine/
"Got error 1 from storage engine"
While indicated to be a storage capacity issue on a MySQL server when researching this error, in Azure Database for MySQL this error is most commonly seen when the MyISAM storage engine is being used. Currently, MyISAM is not supported on Azure Database for MySQL. In this scenario, you will need to modify the tables to utilize a supported engine such as InnoDB. This is the engine that Azure Database for MySQL uses by default.
This article Converting MyISAM to InnoDB will help you understand the implications of changing from MyISAM and the suggested conversion steps to InnoDB. The most common method is to alter the existing table to utilize the InnoDB engine:
1
ALTER TABLE table_name ENGINE=InnoDB;
You can identify the tables in your database using MyISAM with this query:
1
2
SELECT TABLE_NAME FROM information_schema.TABLES
    WHERE TABLE_SCHEMA = 'dbname' AND engine = 'MyISAM';
After converted, you will need to create a new dump of the database and try the import again.
If you already have the dump of the database or are unable to make changes to the source database, another approach is by editing the dump file with your favorite editor.  You will want to find all instances of MyISAM in the dump file and replace with InnoDB. An example using vi in a Unix environment:
:%s/MyISAM/InnoDB/gc
This will allow a global search and confirmation of each change (drop the c to apply it for all instances without confirming each change).
With the edited dump file you will now be able to import without the previously observed error. In both methods, it is recommended to test this change before implementing into production.
In regards to support for MyISAM, see the comment from JasonH@MSFT in May 2017, at the end of article “What is Azure Database for MySQL? Service Introduction”:
“MyISAM support has been asked for several times, and has currently been denied in the feature feedback here because of lack of data consistency (think ACID principles): https://feedback.azure.com/forums/597982-azure-database-for-mysql/suggestions/19271050-add-myisam-engine-support

MyISAM has other limitations that don't make it right for this kind of service right now:
https://dba.stackexchange.com/questions/1/what-are-the-main-differences-between-innodb-and-myisam

Repair. MySQL Storage Engine – How to Convert MyISAM to InnoDB
https://kinsta.com/knowledgebase/convert-myisam-to-innodb/
Step 1  Login to phpMyAdmin and click into your mySQL database.
Step 2
Do a quick scan or sort of the “Type” column and you can see which Storage Engine types your tables are using. In this example below, you can see that two of the tables are still using MyISAM.
find myisam tables
Find MyISAM tables
Alternatively, you could run a query to see if any myISAM tables exist. Replace ‘database’ with your database name.
SELECT TABLE_NAME,
 ENGINE
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'database' and ENGINE = 'myISAM'
Convert MyISAM to InnoDB with phpMyAdminYou can convert MyISAM to InnoDB fairly easily. This example is below is using the wp_comments table. Simply run the ALTER command to convert it to InnoDB storage engine. Note: We always recommend backing up your MySQL database before running any operations on it.
ALTER TABLE wp_comments ENGINE=InnoDB;
Ensure you are running MySQL 5.6.4 or higher otherwise, you might run into issues where full-text indexing is not supported yet by InnoDB. If you are a Kinsta client you don’t need to worry about this.
Alternatively, you can also convert them manually with phpMyAdmin. Simply click on the myISAM table, click into the “Operations” tab, and change the storage engine.
convert myisam table to innodb phpmyadmin
Convert MyISAM to InnoDB

5/07/2019

Haproxy - wordpress problem in SSL

A problem in WordPress SSL HAPROXY


Have a problem to put your SSL in your WordPress using HAPROXY as a reverse proxy?


To resolve this is simple

Add in  wp-config.php

define('FORCE_SSL_ADMIN', true);
define('FORCE_SSL_LOGIN', true);
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
  $_SERVER['HTTPS']='on';


Add this in your haproxy.


frontend webfront
  mode http
  bind 0.0.0.0:443 ssl crt /etc/haproxy/certs.d
  reqadd X-Forwarded-Proto:\ https
  ...
  ...





Make sure to use option http-server-close as well or the reqadd setting might not work as expected.

5/06/2019

Remote Server returned '550 5.2.3 RESOLVER.RST.RecipSizeLimit; message too large for this recipient'

Office 365 or Exchange online problem
Remote Server returned '550 5.2.3 RESOLVER.RST.RecipSizeLimit; message too large for this recipient'







Confirm the problem, 


 Get-Mailbox | fl mailboxplan,maxsendsize,maxreceivesize


If you have 

 Get-Mailbox user@mailbox.com | fl mailboxplan,maxsendsize,maxreceivesize


MailboxPlan    : ExchangeOnline-1ab122338-4f1a-bac1-c28ff8a1234
MaxSendSize    : 0 B (0 bytes)
MaxReceiveSize : 0 B (0 bytes)

Execute the command
 Set-Mailbox user@mailbox.com -MaxReceiveSize 55MB -MaxSendSize 55MB 
or 
 Set-Mailbox user@mailbox.com -MaxReceiveSize 150MB -MaxSendSize 150MB

To apply for all users run this. 
Get-Mailbox | Set-Mailbox -MaxReceiveSize 55MB -MaxSendSize 55MB

How to connect in your Office365 or Exchange online


How to connect in your Office365 or Exchange online


Using the script below.


5/02/2019

Azure Debian apt update problem ?



Sometimes when the Debian is old, and you try to install or update something, the APT doesn't work in Debian machine in Azure VM, need to update the apt.




I got these errors

Err http://debian-archive.trafficmanager.net/debian/ jessie-backports/main pinen                                                                                                                                                     try-gtk2 amd64 0.9.7-5~bpo8+1
  404  Not Found [IP: 52.233.239.54 80]
Get:6 http://debian-archive.trafficmanager.net/debian/ jessie/main gnupg-agent a                                                                                                                                                     md64 2.0.26-6+deb8u2 [273 kB]
Err http://debian-archive.trafficmanager.net/debian/ jessie-backports/main libks                                                                                                                                                     ba8 amd64 1.3.5-2~bpo8+1
  404  Not Found [IP: 52.233.239.54 80]
Get:7 http://debian-archive.trafficmanager.net/debian/ jessie/main gnupg2 amd64                                                                                                                                                      2.0.26-6+deb8u2 [1398 kB]
Get:8 http://debian-archive.trafficmanager.net/debian/ jessie/main libgtk2.0-bin                                                                                                                                                      amd64 2.24.25-3+deb8u2 [535 kB]
Fetched 7839 kB in 1s (5669 kB/s)
E: Failed to fetch http://debian-archive.trafficmanager.net/debian/pool/main/lib                                                                                                                                                     a/libassuan/libassuan0_2.4.3-2~bpo8+1_amd64.deb  404  Not Found [IP: 52.233.239.                                                                                                                                                     54 80]

E: Failed to fetch http://debian-archive.trafficmanager.net/debian/pool/main/p/p                                                                                                                                                     inentry/pinentry-gtk2_0.9.7-5~bpo8+1_amd64.deb  404  Not Found [IP: 52.233.239.5                                                                                                                                                     4 80]

E: Failed to fetch http://debian-archive.trafficmanager.net/debian/pool/main/lib                                                                                                                                                     k/libksba/libksba8_1.3.5-2~bpo8+1_amd64.deb  404  Not Found [IP: 52.233.239.54 8                                                                                                                                                     0]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?



OR this 

Hit http://security.debian.org jessie/updates/main Sources
Ign http://apt.newrelic.com newrelic/non-free Translation-en
Ign http://apt.newrelic.com newrelic/non-free Translation-fr
Hit http://security.debian.org jessie/updates/main amd64 Packages
Err http://debian-archive.trafficmanager.net jessie-backports/main amd64 Packages
  404  Not Found [IP: 52.233.239.54 80]
Ign http://debian-archive.trafficmanager.net jessie-backports/main Translation-en
Ign http://debian-archive.trafficmanager.net jessie-backports/main Translation-fr
Hit http://security.debian.org jessie/updates/main Translation-en
Fetched 2663 B in 2s (1324 B/s)
W: GPG error: http://debian-archive.trafficmanager.net jessie InRelease: The following signatures were invalid: KEYEXPIRED 1507383481
W: Failed to fetch http://debian-archive.trafficmanager.net/debian/dists/jessie-backports/main/source/Sources  404  Not Found [IP: 52.233.239.54 80]