I'm looking for something similar to the table creation form from phpmyadmin, but it should simply display a CREATE TABLE statement in a textarea below the form.
It should also not require MySQL, PHP, or even a server to work.
I want this for times I'm working on projects and just want to whip up a quick table definition. I'll more than likely always have a text editor open, so being able to save to file isn't a must-have.
I'm on Ubuntu and use Gnome. A tiny GTK application I could stick in my Applications menu would be ideal.
It's not that hard to get familiar enough with the syntax that knocking out a table definition in a text editor becomes second nature.
However, check out DBDesigner4, which is a GPL application which might be useful to you.
Use the MySQL Workbench: http://dev.mysql.com/downloads/workbench/5.0.html
Download and install it.
To see the screen you want, you have to open a connection first under "Open Connection to Start Querying".
Enter your root password (or other, if your connection is for another user).
Then your SQL Editor should immediately open.
From the left column, under 'schemas', open your database,
then right-click on 'Tables'.
Select 'Create Table.'
Related
I apologise in advance for I know that this question has been asked several times already, but being a complete beginner at wordpress coding and database handling, I am still not sure about what those answers really meant.
So having just coded a website and converted it into WordPress, I now find myself having to change all of the localhost strings to the accurate ones, but with hundreds to go through, I just wanted to know if any of you were able to recommend a program or technique within PHPMyAdmin (that I may not be aware of) to avoid having to change them one at a time.
Thank you all in advance for your time and attention.
First, let me start by saying this is very dangerous, especially for an absolute beginner such as yourself. Please use this with extreme caution as you can potentially bring the entire site down by replacing values in your database with the wrong data.
With that said, there is a script specifically designed for doing search and replace on the WordPress MySQL database. http://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Here's the direct download link: https://github.com/interconnectit/Search-Replace-DB/archive/master.zip
You will extract the folder from the donwloaded zip, then upload the folder to the root of your WordPress install. Once its uploaded just reference the folder in the browser. I always rename the folder to sr (shorthand for search and replace) so its easier to write out the full URL. So as an example, once its in the root of the WordPress install you'd access it like www.example.com/sr/.
After you access the script in the browser, you'll have a GUI with two boxes at the top. The first you'll enter the string you're searching for, and the replace string goes in the second box. Your MySQL details/login should already be populated. After entering your S&R terms scroll down and click "Update Details", then do the "Dry Run" option first. It'll run through the database and show you the values that will be changed. If you are satisfied with the changes, click "Live Run".
Depending on the database size it'll take just a short time to complete. This is the easiest way to S&R the WordPress database.
Important: for security reasons you'll want to delete this folder from your server after you have finished using it. You don't want a database S&R utility just lingering around for no reason.
Another possible option if you're familiar with WP-CLI is to use the wp search-replace command: https://developer.wordpress.org/cli/commands/search-replace/ This would be done through Terminal or another command line utility.
In phpMyAdmin open your table, choose Search > Find and replace. Then specify in which column you want to find and replace, and the original and replacement texts.
Without any doubt I would use http://interconnectit.com/products/search-and-replace-for-wordpress-databases/
This tool is especially designed for the situation you describe.
You upload the code to your server and then enter the "find" and "replace"
You can then do a dry run and the system will show you all the replaces that will be made across every single table in your Wordpress database.
Once you're happy then you can do a live run and the changes are made.
I have used this on probably one hundred Wordpress sites and it works a charm.
EDIT: Please ignore the Database Type "MySQL". I have it set to H2 currently, I was just playing around with settings at the time of the screengrabs in an attempt to see if I could pinpoint what was going wrong.
My friend came to me tonight with an "Opportunity". He had a college student code a front end application to insert, update, delete, and view data on a local drive for a small company that he runs. The application broke when he updated windows, and now he needs to retrieve the data. He sent me the .mv.db file, so I did some digging and found that DbVisualizer could allow me to atleast use a simple MySQL query to pull his data out into an excel spreadsheet. According to him, there are only about 300 records in the database.
When I connect to the embedded H2 database, it opens up two empty databases.
Let me know if anybody knows what to do here. Thanks.
I ran into the same problem. Luckily my database was small as well so I could use SQuirreL SQL Client to open the database. It is not easy to get used to the user interface but it does a really good job.
If you want to export your data you probably want to change the settings (File -> Global Preferences, Tab SQL Script). I unticked the box 'Qualify .. with schema' to get valid SQL.
Also the date format is not standard conform. I used a text editor to get executable SQL.
Is it possible to create an exe that you click and it opens an interface with a textbox and inside that textbox whatever you type, gets added into a MySQL db after you hit submit?
I would add the info into a DB using PHP but maybe use VB or something else that would allow me that easy interface whenever I need it to put text into a box and submit it and that exe will send the data to the php script to write into MySQL.
I know that I can create an interface or form using php and submit that to write text into MySQL but I want to use an exe instead, a quick easy icon on my computer that I can click and input the text to enter into the DB rather than going to a url for the interface.
Any ideas?
Of course its possible.
In this case though.. why not just use a MySQL GUI such as HeidiSQL?
There is a pretty good selection of software that lets you do exactly this.
PHPMyAdmin is popular, but I have found it to be clunky and too intrusive.
Part of the MySQL project, MySQL Workbench seems well-supported, though I have not used it
The open-sourced version of SQLYog is a Windows client that I've been using for years, and it seems to get the job done well.
I want to take the whole database. Where do I find the database file?
And is there a way to write the whole database with all data to a text file (like the one in SQL Server)?
How to generate SQL scripts for your database in Workbench
In Workbench Central (the default "Home" tab) connect to your MySQL instance, opening a SQL Editor tab.
Click on the SQL Editor tab and select your database from the SCHEMAS list in the Object Browser on the left.
From the menu select Database > Reverse Engineer and follow the prompts. The wizard will lead you through connecting to your instance, selecting your database, and choosing the types of objects you want to reverse engineer.
When you're all done, you will have at least one new tab called MySQL Model. You may also have a tab called EER Diagram which is cool but not relevant here.
Click in the MySQL Model tab
Select Database > Forward Engineer
Follow the prompts. Many options present themselves, including Generate INSERT Scripts for Tables which allows you to script out the data contained within your tables (perfect for lookup tables).
Soon you will see the generated script in front of you. At this point you can Copy to Clipboard or Save to Text File.
The wizard will take you further, but if you just want the script you can stop here.
A word of caution: the scripts are generated with CREATE commands. If you want ALTER you'll have to (as far as I can tell) manually change the CREATEs to ALTERs.
This is guaranteed to work, I just did it tonight.
Q#1: I would guess that it's somewhere on your MySQL server?
Q#2: Yes, this is possible. You have to establish a connection via Server Administration. There you can clone any table or the entire database.
This tutorial might be useful.
EDIT
Since the provided link is no longer active, here's a SO answer outlining the process of creating a DB backup in Workbench.
In MySQL Workbench 6, commands have been repositioned as the "Server Administration" tab is gone.
You now find the option "Data Export" under the "Management" section when you open a standard server connection.
there is data export option in MySQL workbech
I found this question by searching Google for "mysql workbench export database sql file". The answers here did not help me, but I eventually did find the answer, so I am posting it here for future generations to find:
Answer
In MySQLWorkbench 6.0, do the following:
Select the appropriate database under MySQL Connections
On the top-left hand side of screen, under the MANAGEMENT heading, select "Data Export".
Here is a screenshot for reference:
None of these worked for me. I'm using Mac OS 10.10.5 and Workbench 6.3. What worked for me is Database->Migration Wizard... Flow the steps very carefully
In the top menu of MySQL Workbench click on database and then on forward engineer. In the options menu with which you will be presented, make sure to have "generate insert statements for tables" set.
Try the export function of phpMyAdmin.
I think there is also a possibility to copy the database files from one server to another, but I do not have a server available at the moment so I can't test it.
Using Windows 10 and MySql Workbench 8.0
Go to Server tab
Go to Database Export
This opens up something like this
Select the schema to export in the Tables to export
Click the button Start Export
Surprisingly the Data Export in the MySql Workbench is not just for data, in fact it is ideal for generating SQL scripts for the whole database (including views, stored procedures and functions) with just a few clicks. If you want just the scripts and no data simply select the "Skip table data" option. It can generate separate files or a self contained file. Here are more details about the feature: http://dev.mysql.com/doc/workbench/en/wb-mysql-connections-navigator-management-data-export.html
in mysql workbench server>>>>>>export Data
then follow instructions it will generate insert statements for all tables data each table will has .sql file for all its contained data
I don't mean the standard mysql-client CLI, but rather something similar to what midnight commander is to filesystem management. The simple command history of the basic cli is not bad but really doesn't cut it when testing more complex query, and the layout of the data isn't that great. PHPMyAdmin is useful and all, but it's ugly and requires a lot of mouse usage.
OS: linux
dbext.vim provides DB access from within Vi. It provides things like stored connections, schema browsing, command history, some auto completion, and bind variables.
I assume there is something similar for Emacs.
I know this is an old question, but just in case neither of the above solutions have worked for you I would like to recommend Mitzasql - a simple text based Mysql client which gives you a quick read-only access to the database, data manipulation can be done through regular sql queries.
disclaimer - I am the author of said tool.
In emacs, there is a build in mode M-x sql-mysql.
You will be prompted for a user name, password, schema name (or database name), and the server name.
From then on, when one opens a .sql file, emacs should bind that .sql file to the SQL buffer associated with the MySQL session.
Inside that mode you can get help with a "Control-H m" keystroke.
There is a family of emacs sql- modes. They all pretty much work the same.