NET Beans - MySQL - mysql

I use NETBeans IDE. I want to use JDBC with MySQL. I have downloaded and installed mySQL 5.5 but I don't know how to use mySQL with NETBeans. How can I do that.

Here is a very good video tutorial form which you can eaisly learn that How to integrate mySQL with netbeans.Also see this for step by step (with pictures) integrationAnd to setup a mySQL server you need to see this

Take a look at the Netbeans documentation that demonstrates how to set up a connection to a MySQL database from the NetBeans IDE. Take a look at the the section: Configuring MySQL Server Properties

Please see the tutorial below:
https://netbeans.org/kb/docs/ide/mysql.html

#xxlali
click services under the window tab in the ide.
right click the database and click new connection
Add mysql in the driver
click 'Next'
type username and password and click test connection.
Finish once the connection is succeded.

Related

MySQL 8.0 Command Line Client crashes right after entering the correct password

MySQL 8.0 Command Line Client crashes right after entering the correct password. I have also checked in services and there is no problem there. I'm using windows
This might be because MYSQL service is stopped.
Open search bar in windows and type services
Open the services application and find MYSQL application.
Click on start
Now open sql command line and try entering password
It is because MySQL Server stop, may be you run another application that use the same port. Try to run MySQL Installer Community, and you will find the program that you have to reconfigure (blue text). Try to configure MySQL Server ant click Test Connection.
It's hard to tell with no debug output or error codes, but disabling ssl might do the trick:
mysql --ssl-mode=DISABLED --host=$MYSQL_HOST --user=$MYSQL_USER ....
I had the same issue, was looking through Google to find an answer and came here. Are you sure, that you provided MySQL password? The root cause of my problem was the fact, that I put the MySQL user instead of MySQL password (the root one). Now everything is working fine.
That could mean that the password is failing. Check CapsLock key.
Go to Control Panel and uninstall MySQL Server only, you don't need to unstall the other MySQL files.
As mentioned here, make sure you can see hidden folders and then delete the following folders:
C:\Program Files\MySQL
C:\Program Files (x86)\MySQL
C:\ProgramData\MySQL
C:\Users<your-username>\AppData\Roaming\MySQL
Reinstall MySQL Server Package only
Select another password (looks like the current password is the problem)
Come here and vote me up :)
Do something nice for someone else ;)

MySQL Workbench Manage Server Instances

I successfully installed MySQL server (I can connect to it manually through the MySQL shell). When I try to establish a connection through MySQL Workbench, the test connection goes through as well. But when I try to view the server's info or interact with the server, an error message pops up that says, "Current profile has no WMI enabled." I have searched for a solution to this problem, and found a few threads like this one: https://www.quora.com/MySQL-Workbench-How-can-I-solve-the-Current-Profile-Has-no-WMI-enable-error-message. However, I just can't find the 'Manage Server Instances' dialog or button anywhere. I am running workbench version 6.3. If anyone has run into this problem then I would appreciate a workaround.
It's unusual that you get that error again. I haven't heard since years of such a problem. Anyway, the solution is still to configure the connection properly. That "configure server instances" link is very old (from WB 5.x). Instead look for the connection editor (titled: Manage Server Connections). You can open the dialog either via the main menu or the small wrench button on the homescreen:

DBeaver error resolving maven dependencies

I am trying to connect to a remote MySQL database using DBeaver 3.6.3.
But when I try to add the server as a new connection, I need to select a connection type. I select MySQL and as soon as I click on next, it gives me this error
I have tried restoring driver settings to default - no effect.
I have tried removing the metadata folder in Users and restarting - no effect
In my case I had to add the Maven index site url in DBeaver as follows:
Go to DbBeaver "Preferences" menu
Locate "Connections" -> "Drivers" -> "Maven"
Click "Add" and paste this link: https://mvnrepository.com
Click "Apply" and "Close"
On the driver settings menu that will appear, click "Download"
After the download has finished, I was able to connect to the database.
Have you tried to reinstall the driver?
I've tried DBeaver on Linux, mysql connector v 5.1.39 worked fine (mysql 5.6.15).
I had issues a month ago with dbeaver and connecting to a mssql db, updating dbeaver to the v4.0.0 fixed it, maybe you could try that too?
You'll have to build it though, if this doesn't scare you: https://github.com/serge-rider/dbeaver
It is possible that you don't have direct internet access on your working plan (e.g. because of some corporate proxy).
In this case you could try:
Download drivers manually from https://jdbc.postgresql.org/download.html and then add jars in driver editor
Try to configure HTTP proxy in preferences
Note: Ref site
https://github.com/dbeaver/dbeaver/issues/1898
I fixed maven dependencies error encountered while installing db driver as follow:
first set up http_proxy if needed
then add the mvn URL repository in the download configuration settings as describe in this issue
Solution tested on DBeaver Version 21.3.5
if any body is facing the above issue then remove the jar files from dbvear library and add the below jar file download from the link below and add it in the driver library and try to connect it.it worked for me hope this might helpful
https://jar-download.com/artifacts/com.microsoft.sqlserver/mssql-jdbc/8.2.0.jre8/source-code

How to connect IntelliJ with local MySQL?

I have been struggling to learn how the localhost MySQL and IntelliJ to connect and program a database related task. Is that Possible? If yes, how to achieve it?
Connecting to a local instance is essentially the same as connecting to a remote instance of MySQL. Just substitute either localhost, or 127.0.0.1 in place of the IP address you would use normally.
To add a new database connection (called a data source in IntelliJ), open the Database window View -> Tool Windows -> Databases, then click the + sign and select Data Source and then MySQL from the sub-menu. The defaults for the MySQL connection should for a local install of MySQL.
To open a connection, right click on your new data source and select Open Console.
Official IntelliJ Documentation - Managing Data Sources
As of Community version 2017.2, the DB Browser does not come bundled with the IDE (at least not on my last two installations). In order to activate it, you should navigate in the IDE in **File->Settings->Plugins->Browse repositories and select "Database" from the dropdown menu. From there you can install the Database Navigator. After the installation has been successful, you should restart the IDE. Then you can select **View->Tool windows->DB Browser.
In recent versions of Idea Community (about 2017.3, but I am not sure) there is no Database tool available anymore, only in Idea Ultimate [1]. Yet worse, the plugin Database Navigator that would fit here to solve this problem is not compatible anymore, at least not with 2018.3 [2].
Uninstalling Idea right now, unfortunately.
[1] https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000411990-Database-option-not-available-under-View-Tool-Windows-in-Intellij-v2018-1-Community-Edition-
[2] https://intellij-support.jetbrains.com/hc/en-us/community/posts/360001759260-Dan-Cioacas-Database-Navigator-plugin-v3-0-8222-0-is-incompatible-with-latest-IntelliJ-IDEA-2018-3
To add a new database connection (called a data source in IntelliJ), open the Database window View -> Tool Windows -> Databases, then click the + sign and select Data Source and then MySQL from the sub-menu. The defaults for the MySQL connection should for a local install of MySQL.
To open a connection, right click on your new data source and select Open Console.
to download Drivers click on "Download missing Drivers" in bottom of the window.
if you want to add JDBC and connect other database vendor like workbench projects (instead of using intelliJ Consol) just follow the steps bellow :
Using JDBC drivers #
Create a connection to a database with a JDBC driver #
If you cannot find a name of a database vendor in the list of data sources, download a JDBC driver for the database management system (DBMS), and create a connection in IntelliJ IDEA. With the JDBC driver, you can connect to DBMS and start working.
In the Database tool window (View | Tool Windows | Database), click the Data Source Properties icon.
In the Data Sources and Drivers dialog, click the Add icon (+) and select Driver and Data Source.
Click the User Driver link.
In the Driver files pane, click the Add icon and select Custom JARs.
Navigate to the JAR file of the JDBC driver, select it, and click
OK.
In the Class field, specify the value that you want to use for the
driver.
Click Apply.
Return to the created data source connection.
Specify database connection details. Alternatively, paste the JDBC URL in the URL field.
To set an empty password, right-click the Password field and select Set empty.
To ensure that the connection to the data source is successful,
click Test Connection.
For more information read the official answer of Jetbrains in following link :
Configuring database connections
https://www.jetbrains.com/help/idea/configuring-database-connections.html#Configuring_database_connections.xml
For anyone who is having trouble connecting IntelliJ Community Edition with MySQL in 2021.
(In IntelliJ Ultimate Database connectivity is supported by default and you can follow the steps shown in the previous answers. However IntelliJ Community Edition does not support it by Default).
Here is what you have to do:
Install "Database Navigator" Plugin. (Settings->Plugins->Marketplace->Search Database
Navigator and install)
Open DB Browser Tab (next to the button that opens/closes Project Window) -> Click Options logo
-> '+' -> Fill the Database fields (Name, host, Port, DB Name, User and Password).
Download the MySQL Java Connector
by searching google for 'java connector mysql'.
Go to File->
Project Structure -> Modules-> Dependencies. Click the '+' on the right side and select 'JARs or directories'.
Navigate and find the Java connector you just downloaded (the file
looks like this: mysql-connector-java-8.0.26.jar). Click apply
and in the project window, under External Libraries, you will see
the .jar file.
For WebStorm you need plugin "database-navigator"
https://plugins.jetbrains.com/plugin/1800-database-navigator

How to connect Liferay Portal with mysql database using eclipse?

I have Liferay 6.2 and i want to connect with mysql database using eclipse IDE.How to connect them and what i have to use. Please give me any example for startup.
Follow the below steps->
Create a new liferay server (Point it to the liferay portal).
Start the server.
When the server will start hit the
localhost:8080.
A page will be displayed for the database
configuration and user configuration.
provide the db name and
usename and password.
Once you provide that, liferay will use
that database.(Obviously that DB should be in your database)
Else you can create a portal-setup-wizard.properties file in \liferay-portal-6.2.0-ce-ga1 directory. Then add the following entries.
admin.email.from.name=Test Test
jdbc.default.password=root
liferay.home=D:/5555555/liferay-portal-6.2.0-ce-ga1
admin.email.from.address=test#liferay.com
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.username=root
jdbc.default.url=jdbc:mysql://localhost/project_monitor_liferay?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
setup.wizard.enabled=false
Else you can follow the below link
http://www.liferaysavvy.com/2013/12/liferay-62-portal-development.html
Here step by step process has been given. If you find it helpful then mark the above as an answer, so that it would be helpful for other persons also.
To use service builder in portlet you can go through the following links..
Learn how to create a portlet and integrate services in it.
https://github.com/liferay/liferay-plugins/tree/master/portlets/sample-service-builder-portlet
http://www.liferaysavvy.com/2014/05/liferay-mvc-portlet-development-with.html
http://www.liferaysolution.com/2011/12/nice-video-tutorial-to-create-sample.html
http://innovationliferay.blogspot.in/p/service-builder-concept.html
Else you can download the liferay cookbook from
http://www.mpowerglobal.com/download-cookbook This book contains all your query. You just need to dig into it and find.