How do I setup my MySQL with Eclipse IDE? - mysql

I am using Eclipse EE IDE and I am using the MySql Connector/J driver. How do I set up a properties file with all the information(DB URL, DBusername,etc) Also I see that you need a DBname and DBurl for the properties file, How do I determine/create this name for the database. I have already looked at the mysql website for this and am still having trouble, if somebody could pleasee help me I would appreciate it.
Solution: I was able to get it working through the plugin available with Eclipse, but I soon realized this limited me with the use of my Tomcat server, so I re organized my directories and set up Tomcat to use with my Eclipse and also be available to other resources.

Eclipse doesn't use a database for anything, so even if you would create a properties file, it would ignore it.
If you're using the DB plugin, then you can use the UI to create a connection for the database. The wizard will ask for all the informations and save them somewhere (probably not as a property file).
If you need the database in your own project, then you must define the format of the property file yourself, read it at startup, and use the information to create a datasource.

You should use phpMyAdmin, or MySQL GUI tools for MySQL setup and management

Related

unable to create connection to mysql from C++Builder

I have C++Builder Community Edition. I am trying to create a connection from a blank project to mysql server. When I do a test, after supplying the right username and password, I get this error message:
Error: [FireDAC][Phys][MySQL]-314. Cannot load vendor library [libmysql.dll, libmariadb or libmysqld.dll]. The specified module could not be found
I was under the impression that one of the selling points of C++Builder is how easy to create a Windows form for database programming?
It is Relatively easy! However you do need to read the docs and understand how FireDac works with C++ Builder/Delphi. One big consideration is the correct bitness of your executable, x86/x64, and which client libs you have on your machine?
If it is x86 then you can use the FireDAC Explorer from within the IDE to get connected, if you have set up the connection definitions correctly and, as Spektre wrote, have MySQL running locally, it will connect? The community version only supports local connections.
Specifically you need to ensure that the MySQL connection definition or string contains all the needed entries. If you're using Windows look in the file located at C:\Users\Public\Documents\Embarcadero\Studio\FireDAC\FDConnectionDefs.ini and make sure it is setup with the proper information.
Read the docs to see how FireDAC uses connection definition files and/or strings. It does take a little effort to get it all working together so you have to be willing to learn it! If after doing some of this, post again with what you've found and be specific and you may find people be willing to help you more.
Embarcadero FireDAC Docs

mySQL: Connection with Eclipse

I have a lots of problem with the connection between eclipse EE and mySQL. I need to create a web application so I need a DB. I downloaded mySQL ( and mySQL workbench ).
I go to connect eclipse to DB but I can't do it.
This is the sequence that I do:
Please give me some information, I need to solve this . Thanks you guys.
So setting up a JDBC connection in Eclipse can be much easier than your approach. You can instead, try this:
Right click on your Java class in the Package Explorer in the Eclipse workspace.
Go down the list that appears until you find Build Path and click Add External Archives.
Find the jar file called mysql-connector-java-version number.jar and open it. This should connect your JDBC to Eclipse!
Hope this helps!

extract and load from mysql DB to another

I would like to extract and load data from mysql DB to another mysql DB without shutting down mysql in the process.
Tried to use the open source Talend community edition.
Used mysql input component, filled connection details which were tested to work.
Component could not connect to mysql and got the error:
Exception in component tMysqlOutput_1
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
though I added to eclipse project the jar: mysql-connector-java-5.0.8.jar
The mysql components in talend should absolutely work out of the box without the need to load any additional drivers. I'd say reinstall talend because something else is wrong.
To manually load your mysql connector, you can use the tLibraryLoad component.
Choose the jar file from the dropdown in the "Basic Settings". It should be there if it's been included in the project.
You can also pick a lib path in the component's advanced settings and add the import line below that.
Again, you certainly shouldn't need to do this for the mysql component. Talend comes with the drivers to connect to all databases that have components.
In fact I've copied those drivers to other programs that didn't come with them.
Good luck!

Dreamweaver/MyBB/MySQl Database?

I have MyBB installed on my server and apparently the template sets are stored via MySQL database instead of downloaded to the remote server. I would like to set up a path in Dreamweaver so I can directly edit template sets without having to go into the acp in MyBB. Otherwise, there's really no way to test locally unless I set up a database on my machine and it wouldn't make sense having two databases with the same entries. Has anyone managed to set up an ftp path through Dreamweaver that will link to a MySQL database, or is this not possible? Thanks in advance.
Has anyone managed to set up an ftp path through Dreamweaver that will
link to a MySQL database, or is this not possible?
Not possible. Dreamweaver will let you create a connection to a MySQL database to query it but you cannot affect the database structure from within Dreamweaver's interface.

How to import a SQL Server .bak file into MySQL?

The title is self explanatory. Is there a way of directly doing such kind of importing?
The .BAK files from SQL server are in Microsoft Tape Format (MTF) ref: http://www.fpns.net/willy/msbackup.htm
The bak file will probably contain the LDF and MDF files that SQL server uses to store the database.
You will need to use SQL server to extract these. SQL Server Express is free and will do the job.
So, install SQL Server Express edition, and open the SQL Server Powershell. There execute sqlcmd -S <COMPUTERNAME>\SQLExpress (whilst logged in as administrator)
then issue the following command.
restore filelistonly from disk='c:\temp\mydbName-2009-09-29-v10.bak';
GO
This will list the contents of the backup - what you need is the first fields that tell you the logical names - one will be the actual database and the other the log file.
RESTORE DATABASE mydbName FROM disk='c:\temp\mydbName-2009-09-29-v10.bak'
WITH
MOVE 'mydbName' TO 'c:\temp\mydbName_data.mdf',
MOVE 'mydbName_log' TO 'c:\temp\mydbName_data.ldf';
GO
At this point you have extracted the database - then install Microsoft's "Sql Web Data Administrator". together with this export tool and you will have an SQL script that contains the database.
MySql have an application to import db from microsoft sql.
Steps:
Open MySql Workbench
Click on "Database Migration" (if it do not appear you have to install it from MySql update)
Follow the Migration Task List using the simple Wizard.
I did not manage to find a way to do it directly.
Instead I imported the bak file into SQL Server 2008 Express, and then used MySQL Migration Toolkit.
Worked like a charm!
In this problem, the answer is not updated in a timely. So it's happy to say that in 2020 Migrating to MsSQL into MySQL is that much easy. An online converter like RebaseData will do your job with one click. You can just upload your .bak file which is from MsSQL and convert it into .sql format which is readable to MySQL.
Additional note: This can not only convert your .bak files but also this site is for all types of Database migrations that you want.
Although my MySQL background is limited, I don't think you have much luck doing that. However, you should be able to migrate over all of your data by restoring the db to a MSSQL server, then creating a SSIS or DTS package to send your tables and data to the MySQL server.
hope this helps
I highly doubt it. You might want to use DTS/SSIS to do this as Levi says. One think that you might want to do is start the process without actually importing the data. Just do enough to get the basic table structures together. Then you are going to want to change around the resulting table structure, because whatever structure tat will likely be created will be shaky at best.
You might also have to take this a step further and create a staging area that takes in all the data first n a string (varchar) form. Then you can create a script that does validation and conversion to get it into the "real" database, because the two databases don't always work well together, especially when dealing with dates.
The method I used included part of Richard Harrison's method:
So, install SQL Server 2008 Express
edition,
This requires the download of the Web Platform Installer "wpilauncher_n.exe"
Once you have this installed click on the database selection ( you are also required to download Frameworks and Runtimes)
After instalation go to the windows command prompt and:
use sqlcmd -S \SQLExpress (whilst
logged in as administrator)
then issue the following command.
restore filelistonly from
disk='c:\temp\mydbName-2009-09-29-v10.bak';
GO This will list the contents of the
backup - what you need is the first
fields that tell you the logical names
- one will be the actual database and the other the log file.
RESTORE DATABASE mydbName FROM
disk='c:\temp\mydbName-2009-09-29-v10.bak' WITH MOVE 'mydbName' TO
'c:\temp\mydbName_data.mdf', MOVE
'mydbName_log' TO
'c:\temp\mydbName_data.ldf'; GO
I fired up Web Platform Installer and from the what's new tab I installed SQL Server Management Studio and browsed the db to make sure the data was there...
At that point i tried the tool included with MSSQL "SQL Import and Export Wizard" but the result of the csv dump only included the column names...
So instead I just exported results of queries like "select * from users" from the SQL Server Management Studio
SQL Server databases are very Microsoft proprietary. Two options I can think of are:
Dump the database in CSV, XML or similar format that you'd then load into MySQL.
Setup ODBC connection to MySQL and then using DTS transport the data. As Charles Graham has suggested, you may need to build the tables before doing this. But that's as easy as a cut and paste from SQL Enterprise Manager windows to the corresponding MySQL window.
For those attempting Richard's solution above, here are some additional information that might help navigate common errors:
1) When running restore filelistonly you may get Operating system error 5(Access is denied). If that's the case, open SQL Server Configuration Manager and change the login for SQLEXPRESS to a user that has local write privileges.
2) #"This will list the contents of the backup - what you need is the first fields that tell you the logical names" - if your file lists more than two headers you will need to also account for what to do with those files in the RESTORE DATABASE command. If you don't indicate what to do with files beyond the database and the log, the system will apparently try to use the attributes listed in the .bak file. Restoring a file from someone else's environment will produce a 'The path has invalid attributes. It needs to be a directory' (as the path in question doesn't exist on your machine).
Simply providing a MOVE statement resolves this problem.
In my case there was a third FTData type file. The MOVE command I added:
MOVE 'mydbName_log' TO 'c:\temp\mydbName_data.ldf',
MOVE 'sysft_...' TO 'c:\temp\other';
in my case I actually had to make a new directory for the third file. Initially I tried to send it to the same folder as the .mdf file but that produced a 'failed to initialize correctly' error on the third FTData file when I executed the restore.
The .bak file from SQL Server is specific to that database dialect, and not compatible with MySQL.
Try using etlalchemy to migrate your SQL Server database into MySQL. It is an open-sourced tool that I created to facilitate easy migrations between different RDBMS's.
Quick installation and examples are provided here on the github page, and a more detailed explanation of the project's origins can be found here.