Offline software like phpmyadmin to open .sql locted in my PC - database

I have a .sql file in my computer and I use msql command line client to open it presently. But it lacks graphical interface. Is there any software that i can install in my windows 7 PC so that i will have an interface similar to phpmyadmin to open .sql file saved in my PC?

maybe you can try MySQL Workbench. Here's the link
http://www.mysql.com/products/workbench/
Also, if you only need to read the contents of the .sql file, you can use Notepad++ or any other text file editor. But I would suggest Notepad++ since it supports alot of files and also provides formatting too.
http://www.notepad-plus-plus.org/

Export it as csv and use excel

Related

pgadmin4 upload file option is not understand below picture is for your reference

Could you Please let me know what is this option in PgAdmin4
This option is useful when you run pgAdmin4 in SERVER mode where your DATA_DIR directory is on remote web server and you want to import some file for example a CSV file from your local system into your table, Web server can not access your local system files directly so first you have to upload that CSV file on that web server and then you can import that CSV file into your table.
Hope this will be useful.

Is there a way to create a .db file in SQLite Database Browser

I am using SQLite Database Browser to manage my databases.
However, I can't find a way to create a .db file out of my database.
Here is a picture of the options in SQLite Database Browser.
In File->Export, I can only create a sql file or a CSV file.
Is there a way to create a .db file out of SQLite Database Browser ?
If no, is there any other way of doing it ?
Sqlite doesn't really have a file extension. By convention, most people use sqlite3 - but you can use anything. Sqlite database is defined by the file format. (See more: http://www.sqlite.org/fileformat.html)
Is there something you're trying to accomplish specifically by using the .db format? If not, you can name it .db, or sqlite3, or whatever you'd like.
Rename HearthStoneData to HearthStoneData.db.
You need to find the file you are working on. Do not use "save as" . The address of the db file is in the top bar. Rename the file in the directory to .db

How to open an .accdb file in Ubuntu?

The development machine I work on has Ubuntu Jaunty Jackalope as its operating system. I have been presented with data for a project I'm working on in the form of an .accdb file created by Microsoft Access. I do not own a copy of Microsoft Access. I do have Open Office installed and would be willing to install any software package available to my operating system. Is there a way I can open or transform this file so that I can view and edit the data on my computer? Is there another format that the Access database could be saved as that I would be able to open?
There are two open source tools available however they only work on MDB format files. Can you ask the supplier of the ACCDB file to give it to you in MDB format?
MDB Tools is a set of open source libraries and utilities to facilitate exporting data from MS Access databases (mdb files) without using the Microsoft DLLs.
Jackcess is a pure Java library for reading from and writing to MS Access databases. It is part of the OpenHMS project from Health Market Science, Inc. . It is not an application. There is no GUI. It's a library, intended for other developers to use to build Java applications. It appears to be much newer than MDB tools, is more active and has write support.
Jackcess now supports everything from Access 97 (read-only), 2000, 2003, 2007, and 2010 (read-write), both .mdb and .accdb files.
Dumping the file can be as easy as
import com.healthmarketscience.jackcess.*;
import java.io.*;
public class AccessExport {
public static void main(String []args) throws IOException {
System.out.println(Database.open(new File(args[0])).getTable(args[1]).display());
}
}
(of course, you need a java compiler, libcommons-logging-java, libcommons-lang-java and you have to pass the .accdb filename as the first and the table name as the second parameter).
-Marcel
I just had this same problem on an Ubuntu 14.01 AWS EC2 instance and I was able to accomplish this task (convert .accdb file to CSV on Ubuntu) by using access2csv. I had to install Git, install Java, and install ant, but then was able to convert the .accdb files I had to CSV by typing:
$ java -jar access2csv.jar myfile.accdb
It uses Jackcess so you get the same functionality without having to write your own Java code to accomplish this basic task. Each table is returned as its own CSV file.
You can also access the schema by passing the --schema option:
java -jar access2csv.jar myfile.accdb --schema
Hope this is helpful. It certainly was for me.
A good format to view and work with on Linux would be CSV.
As the accepted answer suggests MDB Tools does the job. To export all the tables on Linux to CSV format try this command:
mdb-tables -d ',' database.accdb| xargs -L1 -d',' -I{} bash -c 'mdb-export database.accdb "$1" >"$1".csv' -- {}
You can use mdbtools also into windows via WSL (Ubuntu on Windows or Debian on Windows):
Then install it in console with:
sudo apt install mdbtools
This may be of interest: How to convert accdb to a postgres database
I am not sure if Wine would suit, but it might be worth a look.
I found this blog: http://tahsinabrar.com/open-a-microsoft-access-accdb-file-in-ubuntu/
In case the link is broken, the contents say:
We can use the UCanAccess JDBC driver to connect to Access databases
(.mdb and .accdb) in LibreOffice Base. Here’s how I did it on a clean
install of Ubuntu 14.04 LTS.
First, I installed LibreOffice Base itself
sudo apt-get install libreoffice-base
Then I downloaded UCanAccess to my Downloads folder and unzipped it.
I launched LibreOffice (not Base, just LibreOffice itself)
LibreOffice.png
and chose Tools > Options
On the Advanced tab I clicked the “Class Path…” button and then added
the following five (5) JAR files using the “Add Archive…” button:
/home/abrar/Downloads/UCanAccess-2.0.9.5-bin/ucanaccess-2.0.9.5.jar
/home/abrar/Downloads/UCanAccess-2.0.9.5-bin/lib/commons-lang-2.6.jar
/home/abrar/Downloads/UCanAccess-2.0.9.5-bin/lib/commons-logging-1.1.1.jar
/home/abrar/Downloads/UCanAccess-2.0.9.5-bin/lib/hsqldb.jar
/home/abrar/Downloads/UCanAccess-2.0.9.5-bin/lib/jackcess-2.1.0.jar
Note that you must close and re-open LibreOffice for the new Class
Path values to take effect.
Then I launched LibreOffice Base, and in Step 1 of the wizard I chose
“Connect to an existing database (JDBC)”
The Access file I wanted to manipulate was named “baseTest.accdb” in
my Downloads folder, so in Step 2 the “Datasource URL” was
jdbc:ucanaccess:///home/abrar/Downloads/baseTest.accdb
and the “JDBC driver class” was
net.ucanaccess.jdbc.UcanaccessDriver
In Step 3, I left the “User name” field empty and just clicked “Next
”.
In Step 4, I saved the LibreOffice Base database as “accdbTest.odb” in
my Documents folder.
When the wizard completed it opened my LibreOffice database and I
could see the tables in the .accdb file
But you have download and unzip UCANACCESS first from here: http://ucanaccess.sourceforge.net/site.html
I can see all the tables in LibreOffice Base. Here is one:
I guess you want to extract data from tables, not code from modules. I do not know specifically Ubuntu but I guess you can connect to the access file using an ODBC connection (or, if available, OLEDB connection) and extract the data? Depending on the connection type, you might still need to know the tables names in order to import them.
Microsoft Access Runtime is a free software. You can install it in Ubntu using Wine and then open the accdb database.
Im not sure if there are any native tools, but you can always install a copy of windows and install a free view for accdb files or install a trial of Access.

SQL Management Studio Express opening SQL scripts in Notepad

When I go to File > Open > File and select a .sql script, or even when I drag a .sql file into the SQL Management Studio Express window, it opens the script in Notepad which is totally useless when I want to run the script.
Since this is on an external server (Windows 2003 Server), I end up having to disconnect from RDP, disable the local clipboard, re-connect and then copy-paste the script's contents from Textpad in order to run it.
I've checked the options menus but can't see anything relating to Notepad, not even in the "external tools" section. Any ideas why it would be doing this?
Please note: I have checked the file association for SQL scripts and it is set to SQL Management Studio Express.
Ran into this this morning. Turned out to be an encoding issue for me. I opened the script up in UltraEdit and I noticed that it was showing the encoding to be U-DOS instead of DOS. I ran the Unicode to ASCII conversion (also in UltraEdit), saved the file, and now Management Studio is opening up the files correctly.
I encountered this too - thanks NFrank for spotting the issue:
This was caused by opening the script in TextPad and accidentally saving as Unicode. The issue is not related to file associations.
The solution: Open in Notepad (or TextPad) - Save As... and select Encoding: ANSI
UPDATE:
In SQL Management Studio,
Go to File > Open > File,
Highlight a SQL file,
Click the down arrow on the Open button.
Select Open With...
Select SQL Query Editor
Press the Set as Default button.
Matt
The first thing I'd check is to see if the application associated with SQL files on that box is Notepad.

Batch file to "Script" a Database

Is it possible to somehow use a .bat file to script the schema and/or content of a SQL Server database?
I can do this via the wizard, but would like to streamline the creation of this file for source control purposes.
I would like to avoid the use of 3rd party tools, just limiting myself to the tools that come with SQL Server.
There is a free tool called SubCommander that is a part of the open source SubSonic software. I have successfully used this tool myself to create both schema and data "dumps" each night.
You can script out your schema and
data (and then version it in your
favorite source control system) using
SubCommander. Simply use the command
"version" and tell SubCommander where
to put the data:
sonic.exe version /out Scripts
This will output a script file (.sql)
to the local scripts directory of your
project
You can also try using the Microsoft SQL Server Database Publishing wizard, although i am not sure that you can use it in a bat file.

Resources