How to configure ejabberd which is installed from Azure marketplace to Azure mysql as service? - ejabberd

I have created mysql instance in azure (Azure mysql service) and also I have created ejabberd from Azure market place (Ubuntu). I have done all the firewall configuration but unable to connect.
error :2018-03-20 13:31:08.248 [error] <0.897.0>#ejabberd_sql:log:935
p1_mysql_conn: in it error 9002:
[35,50,56,48,48,48,83,83,76,32,99,111,110,110,101,99,116,105,111,
110,32,105,115,32,114,101,113,117,105,114,101,100,46,32,80,108,101,97,115,101,32
,115,112,101,99,105,102,121,32,83,83,76,32,111,112,116,105,111,110,115,32,97,110
,100,32,114,101,116,114,121,46,0] 2018-03-20 13:31:08.249 [error]
<0.378.0>#ejabberd_sql:log:935 p1_mysql_conn: po st_start error
login_failed 2018-03-20 13:31:08.249 [info]
<0.378.0>#ejabberd_sql:connecting:324 mysql conne ction failed:

Check whether you comment this line in your MySql my.cnf file
#bind-address = 127.0.0.1
Allow your Ejabberd Ip to mysql
GRANT ALL ON *.* to root#'<<ejabberd private ip>>' IDENTIFIED BY '<<’mysql password’>>';
FLUSH PRIVILEGES;

Related

Error 1045 access denied from DMS source database

I got below error while try to migrate database from Mysql enterprise version 8.0.23-commercial even I grant all REPLICATION CLIENT, REPLICATION SLAVE to migration user I still got this error and also turn on binlog
[SOURCE_CAPTURE ]E: Error 1045 (Access denied for user 'migration'#'IP' (using password: YES)) connecting to MySQL server 'IP' [1020414] (mysql_endpoint_capture.c:297)
2021-09-28T17:46:20 [SOURCE_CAPTURE ]E: Errors in MySQL server binary logging configuration. Follow all prerequisites for 'MySQL as a source in DMS' from https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.MySQL.html or'MySQL as a target in DMS' from
https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.MySQL.html [1020414] (mysql_endpoint_imp.c:778)
If migrate full load only via this endpoint it successfully this error found when full load + on going migration
To replicate database migration must use TCP/IP port. You should check this port and run database migration again.
I faced same issue while working on AWS DMS RDS mysql to MSK Kafka data migration. I resolved by configuring mysql source endpoint with Secure Socket Layer (SSL) mode verify-ca.
To get a certificate bundle that contains both the intermediate and root certificates for all AWS Regions, download from https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem.
You can valuvate your error in following doc
https://www.percona.com/blog/2019/07/05/fixing-a-mysql-1045-error/

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' -Centos 7.1

Logs:
20088:20180822:152017.613 cannot send list of active checks to "127.0.0.1": host [Zabbix server] not monitored
20100:20180822:152202.973 [Z3005] query failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) [select escalationid,actionid,triggerid,eventid,r_eventid,nextcheck,esc_step,status,itemid from escalations where triggerid is not null order by actionid,triggerid,itemid,escalationid]
20100:20180822:152202.973 [Z3001] connection to database 'zabbixdb' failed: [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
20100:20180822:152202.973 database is down: reconnecting in 10 seconds
In mysql set grant zbbixdb to to zabbixuser for IP 127.0.0.1 and try again
grant all privileges on zabbixdb.* to 'zabbixuser'#'127.0.0.1';
Grant all privileges to the Zabbix user that you have defined in your zabbix agent configuration file and grant him privileges over the database that you have specified on the same conf. file.
grant all privileges on ZabbixDBName.* to 'ZabbixUserUsed'#'127.0.0.1';
use this query in mysql for the same.

TALEND - Vagrant Mysql connexion issues

I'm pulling my hair over the following situation.
I'm unable to connect to my MySQL server in Vagrant (2.0.0 , OS: Ubuntu 16.04 ) with only specific applications (HeidiSQL and Talend 6.1).
This error happens with Talend MySQL components with the mysql-connector-java-5.1.30 jar and Java 1.8 JRE.
I receive the following error each time when connecting either directly (TCP/IP) or over SSH (TCP/IP over SSH) to the MySQL Server with the aforementionned applications:
Access denied for user 'user'#'IP' (using password: YES)
This however doesn't happens with MysqlWorkbench with both direct connection (TCP/IP) or over SSH with the same user credentials. Below are the settings of the MySQL server:
MySQL Server Network Info
Maria Db: 10.0.34
bind-address: 0.0.0.0
skip-name-resolve: true
The following have already been tried and tested:
Access credentials and privileges verification
DNS flush both on Guest and Host machines
Addition of MySQL server IP to host file
Verification of ports opening both on host and guest
The following solved the issue:
GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'#'%' WITH **GRANT OPTION**;
The GRANT OPTION does the trick.
Alternatively this could be caused by wrong driver being used in your Talend workspace. To update the MySQL connector JAR follow the steps below:
Donwload the updated connector driver here
Replace the 'tMySQLOutput/tMySQLInput' component(s) with an equivalent tJDBC ones
Add the new connector JAR (No 2 on the image) and the class name com.mysql.jdbc.Driver (No 4 on the image) (ref https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-installing-classpath.html)

Unable to connect to Google SQL over SSL

I created a fresh instance of google sql with mysql 5.7. I also had to create a client certificate as well as reset the root password to something known and secure.
If I disable "Only allow secure connections" and I log in from the cli then I can connect with the password.
mysql -uroot -p -h x.x.x.x
But, i like secure connections. So connecting via ssl (enabling ssl connections and using the downloaded certs) is unable to connect.
mysql -uroot -h x.x.x.x --ssl-ca=server-ca.pem --ssl-cert=client-cert.pem --ssl-key=client-key.pem
with this error
mysql: [ERROR] SSL error: Unable to get certificate from 'client-cert.pem'
ERROR 2026 (HY000): SSL connection error: Unable to get certificate
If I try and connect via ssl in mysql administrator, I get this error:
The certs were created by the google console and am trying to connect how the example command tells me to connect. So I cannot for the life of me figure out why I cannot connect.
It seems that when creating a client certificate, Google Cloud is putting the CRT inside the client-key.pem and the KEY inside the client-cert.pem.
Does it work if you try the following?
mysql -uroot -h x.x.x.x --ssl-ca=server-ca.pem --ssl-cert=client-key.pem --ssl-key=client-cert.pem

Failed to connect to MySQL at 127.0.0.1

Regarding the first answer to the Question Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user 'root'#'localhost'(using password:YES), after step 3, says if connection is denied then type
mysql >GRANT ALL ON [DatabaseName].* TO 'root'#'127.0.0.1' IDENTIFIED BY '[PASSWORD]';
But when i type the following in command prompt of Windows,
C:\Program Files\MySQL\MySQL Server 5.6\bin>GRANT ALL ON MySQL Server 5.6.* TO'root'#'127.0.0.1' IDENTIFIED BY '[password]';
I get the following error.
'GRANT' is not recognized as an internal or external command,operable program or batch file.
Please help as I'm trying to establish the connection between MySQL and the Database.