I'm trying to do school JAVA EE project and I have to connect schema made in mysql from MYSql.
part of code is (for SQL select) :
String dbURL = "";
String user = "root";
String password = "root";
and i apperently have no URL somehow
Any ideas on that? I'm new to SQL and JAVA EE so i face lots of problems :/
First of all you need a running mysql instance. There are 2 possibilities :
(1) You need the domain :
local instance / domain : localhost
Remote instance / domain or IP
(2) You need the port of the mysql server instance
Default is 3306
(3) The name of the database you want to connect to.
Lets say you need to connect to the database test
Now in order to connect to the database you will need to generate the connection url. In our case since (I assume) you want to write java, the url is in jdbc format
jdbc:mysql://localhost:3306/test
In order to connect netbeans to a mysql Database you will need to follow the next steps :
Locate the service tab on the project tab and right click on the Databases.
Select the Mysql Driver and click next. (If the driver misses just download the file from the suggested portal it will be a jar).
Finally fill the appropriate information on the next frame
If you need parameters to your jdbc URL you can do so like :
jdbc:mysql://localhost:3306/test?param1=value1
You can find more detailed information on the Netbeans website : https://netbeans.org/kb/docs/ide/mysql.html
Related
I've found this in a software developed by another with j2ee spring_hibernate tomcat_v7 and jre7.
the dbURL is written as follow
dburl = "jdbc:sqlserver://remoteip\\local\\local:1433;database=dbname"
what does the double local means? when removed them the link to sql server 2008 doesn't work anymore.
simple answer to this is in the "integratedSecurity=false;"
when you want to connect to the database installed in the same machine and by the windows authentication then use "integratedSecurity=true" without login or password while you have to put the dll existant in the auth file in the jre lib directory
however if you want to use another machine (remote) this time the integratedSecurity will never work so you will have to choose the sql server connection and then absolutly use "integratedSecurity=false"
String connectionUrl = "jdbc:sqlserver://ServerName\\databaseInstance:1433;databaseName=DBSS;integratedSecurity=false;user=user;password=pass";
you may also open the sql server config manager and set TCP/IP to enabled, the ip adress (IPALL) dynamic to nothing (delete the 0) and the port to 1433 (same as the string connection) and restart the sql server service
you'll probably also need to create a firewall unbound rule for that port.
hope this will help others.
The scenario is as follows:
I am writing an node.js app locally and want it (the mySQL modul, rather) to connect to a mySQL db running on Google Cloud Platform.
I can not get the connection string right and keep getting errors. GCP holds two names for the database - one i picked, one generated, more complex. Problably I should supply one of these into the connection string as "database", the host is likely the IP address with port (or not(?)), I am not sure what the "user" should be, or if it is necessary. Not enough info on the GCP help pages or elsewhere.
tl;dr: I need the following to connect a node.js app with a mySQL module remotely to a GCP database:
var con = mysql.createConnection({
host:"11.222.333.444:3306",
user: "me"
password:"passwo3d",
database:"projectname-1528892969949:europe-west5:dbname"
});
Thank you!
The raw connection string should look something like: mysql://user:password#localhost:port/db
So I think your code should look something like:
var con = mysql.createConnection({
host:"11.222.333.444", <-- remove the port from your string
user: "me"
password:"passwo3d",
database:"dbname" <-- you have it as the instance name .. its just suppose to be the DB name
});
You can also try connecting to the instance using the cloud proxy setup. You host would just be localhost.
Finally you can always go the GCP console -> go to your instance and open up a shell. I think they print out the gcloud cmd in there and you can copy values from the console as well.
Depending on how you are pushing your code, you may have to change a few connections strings in your manifests as well. If you can share those I can help further.
For that to happen, you have to first enable remote access for your mysql on your GCP. A step by step guide is over here, you can leave the first few steps for installing mysql.
I'm using Outsystems Service Studio to develop a web application. I need to configure a connection to access a local server database. I get "Connection String test failed: Unable to connect to any of the specified MySQL hosts." I just figured out I can't connect using "localhost", because the Outsystems server is not local, but I'm not able to find a solution. what is wrong? Other details:
MySQL Server is up and running
I selected MySQL in DBMS
Inserted my schema name
Inserted the username (with all privileges granted)
Inserted the user password
Tried both basic and advanced configuration. I inserted j"dbc:mysql://127.0.0.1:3306/mydb?user=outsystems2" as connection string parameters and I get "Connection String test failed: Keyword not supported.Parameter name: mysql://127.0.0.1:3306/mydb?user". I know this connection string can't work , but I'm not able to find a functioning one. I've read many guides about this configuration, but no solution was found. Thank you all for your time and help, feel free to ask for more details
Luciano,
Is your OutSystems environment on-premises or in the cloud? Either way, you need to make sure that this server is able to reach - it as connectivity - to your MySQL database server. Using localhost or 127.0.0.1 is pretty much the same thing as this is an address for the machine where the request is running, which is, in this case, the OutSystems server. Do you have the MySQL database on your local machine? This is not a good approach as you will need to have an address that won't change otherwise the connection won't be stable and you'd have to reconfigure it all the time.
Regards
I am trying to make the connection to a remote mysql database in CloverETL Designer (Community Version)
Documentation with examples on this subject seem fragmented so I have tried to piece the bits together but I'm not use if they are correct. I would be grateful for any suggestions or further clarification on this subject.
Here is what I have so far:
The SSL Certificate
As an alternative VPN connection the server guys passed me the raw CA certificate, which I saved as a .crt file in the conn folder of the CloverETL workspace.
CloverETL Connections
I created a new DB connection and tested it was working without SSL
In the graph window I created a simple graph
Switching to Source View I added the parameter attribute to the connection code like this:
<Connection database="MYSQL" dbURL="jdbc:mysql://hostname/database_name" id="JDBC0" jdbcSpecific="MYSQL" name="CPM" parameters="ssl=${WORKSPACE}/conn/mysql_cpm_cert.crt" password="password" type="JDBC" user="username"/>
Then I tested the connection to the database by creating new metadata from a DB table
The problem is that I don't know if the connect is now secure or not.
Here's the list of resources that I used to piece together the information:
components:bulkloaders:mysql_data_writer [CloverETL wiki]
MySQL :: MySQL 5.0 Reference Manual :: 6.3.6.3 SSL Command Options
Thanks
CPM
Your setup almost certainly does not use ssl. Both links you posted are not usable - first describes bulk loader and second connection via command line client. But what you need is to configure JDBC. So I would use http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html section "Security."
I would set:
useSSL=true
requireSSL=true
You will do that by adding items in table (Custom JDBC properties) on second tab (Advanced) of Connection Wizard. In source it should appear like "jdbc.useSSL=true jdbc.requireSSL=true" not "parameters=".
Then connection should fail, because in your default java key store is missing your certificate. It can be imported via http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/keytool.html section "Importing Certificates"
I hope this helps.
I have installed a local server Xampp, which is running mySQL database in Windows. I created a Database on it with one table. The thing is I cannot get a connection to the database when I use the dbExpress TSQLConnection component. When I set the properties as follows:
ConnectionName = MYSQLConnection
Driver = MySQL
Database = databaseName
HostName = localhost
password =
UserName = root
When I change the connected property to true, I get the following error:
Borland.Data.TDBXError: DBX Error: Driver could not be properly initialized. Client library may be missing, not installed properly, of the wrong version, or the driver may be missing from the system path
I have tried making a connection to the database using the Data Explorer, but I still get the above error. I do not know what I'm missing or doing wrong.
Im using Delphi-XE2.
with mySQL on the server: MySQL client version: mysqlnd 5.0.7-dev - 091210 - $Revision: 304625 $.
I have also tried using an ADO connection, but I do not know how to set the connection string.
I'm still a noob and just want to learn how to make a connection to a mySQL database running on a web server. I cannot afford to buy any components.
Try this!
Did some google Fu - and stumpled upon this link : http://wiltonsoftware.com/posts/view/getting-embarcadero-dbexpress-mysql-working-dbx-error-driver-not-initialized
That seems to fit your needs.
My previous answer was no help .. hope the new one is better.
Old answer:
Make sure you have Data.DBXMySQL in your uses clause.
OK. I'll try a different approach.
Is it working if you setup the connection in the DataExplorer?
If not - then it's not a problem with the uses clause.
(and you obviously have tried that - sry . must be tired :-))
Otherwise a unit could be like this.
unit Unit1;
interface
uses // <-- Uses normally goes right after interface .... (you probably already have one)
Data.DBXMySql;
implementation
end.