Please see the edits below, I leave the original question to help others.
I am trying to connect to a local MySQL server through Script and JDBC applications, but I keep getting one of two errors. This code:
function connectTest() {
var conn = Jdbc.getConnection("jdbc:mysql://localhost", "root", "xxx");
}
Gives an error Failed to establish a database connection. Check connection string, username and password.
This code:
function connectTest() {
var conn = Jdbc.getConnection("jdbc:mysql://localhost:3306", "xxx", "pass");
}
Gives an error Invalid argument: url
.
I have tried dozens of combinations and can't make it work. Attempts to log in from application scripts are not displayed in the access log for MySQL (i.e. if I try to log in locally with the wrong information, I see [Note] Access denied for user 'host'@'localhost' (using password: YES)
. I have granted the appropriate root authority:
mysql> show grants for 'root'@'%';
+-------------------------------------------------------------+
| Grants for root@% |
+-------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION |
+-------------------------------------------------------------+
1 row in set (0.00 sec)
Do I need to do something to open a local database on the Internet / Google Apps Script?
EDIT:
MySQL (, Access denied for user 'root'@'12.123.12.123' (using password: YES)
), - . bind-address
IP-, MySQL , ([ERROR] Can't start server: Bind on TCP/IP port: Can't assign requested address
)
function connectTest() {
var conn = Jdbc.getConnection("jdbc:mysql://12.123.12.123:3306", "root", "xxx");
}
EDIT2: bind-address = 0.0.0.0, , . MySQL (, ensembldb.ensembl.org:3306), .