Using Talend to connect to a MySQL database, prompting no permissions, and finally found that the MySQL server configuration only listens to the 127.0.0.1 port, rejecting non-local requests. By commenting out the bind_address entry in/etc/mysql/my.cnf,/etc/init.d/mysql restart restart the MySQL server, Talend can access the database normally:
[Email protected]:~/extract/extract_mysql#VI/etc/mysql/MY.CNF # # # The MySQL database server configurationfile. # # can copy this to one of:#-"/etc/mysql/my.cnf"To set global options,#-"~/.my.cnf"To set user-specific options.# # One can use allLongOptions The program supports.# Run--Help to get a list of available options and with#--print-defaults to seewhichit would actually understand and use.## for explanations see# http://dev.mysql.com/doc/mysql/en/server-system-variables.html# This would be passed to all MySQL clients# It had been reported that passwords should is enclosed with ticks/quotes# escpeciallyifThey contain"#"chars ... # Remember to edit/etc/mysql/debian.cnf When changing the socket location. [Client]port=3306Socket=/var/run/mysqld/mysqld.sock# Here is entries forsome specific programs# the following values assume you are least 32M ram# this is formally known as [Safe_mysql D]. Both versions is currently parsed. [Mysqld_safe]socket=/var/run/mysqld/Mysqld.sock Nice=0[mysqld]##*Basic Settings#user=Mysqlpid-file=/var/run/mysqld/Mysqld.pidsocket=/var/run/mysqld/Mysqld.sockport=3306Basedir= /Usrdatadir=/var/lib/Mysqltmpdir= /TMPLC-messages-dir=/usr/share/Mysqlskip-external-locking## Instead of Skip-Networking The default is now- listen only on# localhostwhichIs MoreCompatible and is not Lesssecure. #bind -address = 127.0. 0.1 #
Use Grant all to assign permissions to the machine IP that is deployed Talend:
Mysql> Grant All on *.* toRoot@172.28.0. AboutIdetified by '123456'; ERROR1064(42000): You had an errorinchyour SQL syntax;CheckThe manual that corresponds toYour MySQL server version forThe RightSyntax to UseNear'idetified by'123456"'At line1MySQL> Grant All on *.* toRoot@172.28.0. AboutIdetified by '123456'; ERROR1064(42000): You had an errorinchyour SQL syntax;CheckThe manual that corresponds toYour MySQL server version forThe RightSyntax to UseNear'idetified by'123456"'At line1MySQL> Grant All on *.* to 'Root'@'172.28.0.74'Identified by '123456'; Query OK,0Rows Affected (0.16sec) MySQL>FlushPrivileges; Query OK,0Rows Affected (0.00Sec
Talend connection to MySQL database does not have permissions