MySQL GUI Tools 5.5 - mysql

When I am editing a record, Query stopped working after close open query browser not showing any data.
I create backup, Table etc. But only query browser not working.Image When select Edit Table Data shows:

Related

MySql database connectivity

I've written code to insert data in mysql database successfully compiled it on cmd and my database along with table is also ready.
I want to know the further steps so that can understand whether my record has inserted or not in mysql
If your code is doing as expected, and there is no error, then the values should be inserted.
Steps to check whether everything is working fine or not:
Go to your database and run this query:
SELECT * FROM tableName
Run the program and insert some data.
Again go to your database and run this query:
SELECT * FROM tableName
If there are changes appeared according to the data inserted, it means your program is working fine.

MySQL Workbench edit data

MySQL Workbench allows one edit Select query results which seems a nice feature, yet if I rerun query the changes do not stick. Is there way to edit tables (preferably in query results). I can run update query, yet sometimes editing is more convenient.
You need to click "Apply" after you finish editing the data, otherwise it will not save the changes.

Mysql Workbench - The best way to organize running frequently used SQL queries while development

I'm a java dev who uses Mysql Workbench as a database client and IntelliJ IDEA as an IDE. Every day I do SQL queries to the database from 5 up to 50 times a day.
Is there a convenient way to save and re-run frequently used queries in Mysql Workbench/IntelliJ IDEA so that I can:
avoid typing a full query which has already been used again
smoothly access a list of queries I've already used (e.g by auto-completion)
If there is no way to do it using Mysql Workbench / IDEA, could you please advise any good tools providing this functionality?
Thanks!
Create Stored Procedures, one per query (or sequence of queries). Give them short names (to avoid needing auto-completion).
For example, to find out how many rows in table foo (SELECT COUNT(*) FROM foo;).
One-time setup:
DELIMITER //
CREATE PROCEDURE foo_ct
BEGIN;
SELECT COUNT(*) FROM foo;
END //
DELIMITER ;
Usage:
CALL foo_ct();
You can pass arguments in in order to make minor variations. Passing in a table name is somewhat complex, but numbers of dates, etc, are practical and probably easy.
If you have installed SQLyog for your mysql then you can use Favorites menu option in which you can save your query and in one click it will automatically writes the saved query on Query Editor.
The previous answers are correct - depending on the version of the Query Browser they are either called Favorites or Snippets - the problem being you can't create sub-folders to group them. And keeping tabs open is an option - but sometimes the browser 'dies' - and you're back to ground 0. So the obvious solution I came up with - create a database table! I have a few 'metadata' fields for descriptions - the project a query is associated to; problem the query solves; and the actual query.
You could keep your query library in an SQL file and load that when WB opens (it's automatically opened when you restart WB and that file was open on last close). When you want to run a specific query place the caret in it's text and press Ctrl+Enter (Cmd+Enter on Mac) to run only this query. The organization of that SQL file is totally up to you. You have more freedom than any "favorites" solution can give you. You can even have more than one file with grouped statements.
Additionally, MySQL Workbench has a query history (see the Output Tab), which is saved to disk, so you can return to a query even month's after you wrote it.

Modifying table entries from LibreOffice Base, possible?

I've successfully connected LibreOffice Base with MySQL data base server. I've tested if I modify my table from host (free hosting service on internet) then the changes are reflected when refreshing the table object in LO Base.
But my question is, can I modify DB table directly from LO Base? I guess that it's possible using sql queries from LO Base, but how? Please give me some insights or tutorials. Thanks.
The normal way to alter a table:
Tools -> SQL
Enter an ALTER TABLE command and press Execute button.
A way that works, even though it complains that no result set is returned:
Create a query in SQL view.
Enter ALTER TABLE command.
Click button in toolbar to mark it as Run SQL command directly. Or Edit -> Run SQL command directly.
Close the query and double-click to run it.
My guess is it could be done with a macro as well, similar to https://forum.openoffice.org/en/forum/viewtopic.php?f=5&t=75763 but using ALTER TABLE.
For more ideas see https://forum.openoffice.org/en/forum/viewtopic.php?f=61&t=37687.
EDIT:
Inserting new row data in a form is easier than altering the table. First, make sure this works:
Double-click on your table under Tables.
Insert -> Record, or enter data in the last new row.
If Insert -> Record is disabled, then you need to set up the table for editing. Make sure that your connection to the database allows editing. Also the table must have a primary key.
Once you can insert records in Table view, it's time to create the form:
Under Forms, Use Wizard to Create Form.
Select your table and press >> to include all fields.
Click Finish.
Now you should be able to open the form and enter data into the final new row.
More complete instructions with examples are at http://www.open-of-course.org/courses/mod/url/view.php?id=786.

MySql workbench query history ( last executed query / queries ) i.e. create / alter table, select, insert update queries

Want to see last executed queries in MySql Workbench whether its
create / alter table query
select / insert / update query
or any query list.
in short want to see history of all queries
From the bottom panel, change "Action Output" to "History" and then choose the appropriate date.
Alternatively, the SQL statement history is stored in text files under two locations:
sql_history/yyyy-mm-dd e.g., sql_history/2015-04-01: Full Workbench SQL history for all MySQL connections
log/sql_actions_.log*: SQL history execution results, but without the data, and separated per MySQL connection
The location of these files depends on your system. For additional details, see
MySQL Workbench Settings and Log Files
In both cases, you will see the query history.
C:\Users[WinUser]\AppData\Roaming\MySQL\Workbench\sql_history
you find a log file for each day. It includes manual and automated queries from workbench (e.g. UPDATES via edit in Table)
Suppose that you can no longer connect to a previous MySQL database instance, and you just want to see your SQL history from the editors. Do this:
Locate your MySQLWorkbench settings folder:
Windows: %AppData%\MySQL\Workbench\ -- which is usually C:\Users\your_username\AppData\MySQL\Workbench\ (Note that the AppData folder is hidden by default, so you may want to unhide AppData first, to see its contents.)
macOS: /Users/your_username/Library/Application Support/MySQL/Workbench/ (Note that the ~/Library folder is hidden by default, so you may want to unhide it first, to see the contents)
Linux: /Users/your_username/.mysql/workbench/
Open the folder sql_workspaces (inside Workbench)
You should see folders of your previous database connections. Navigate into one of them.
There should be several "*.scratch" files. They are text files of editor history of SQL queries.
Open these *.scratch files in a text editor, and copy the contents.
You will find a complete History file in:
C:\Users\[WinUser]\AppData\Roaming\MySQL\Workbench\log\sql_actions_unconnected.txt
MySQL Workbench could not open History file for some reason, but I was able to recover my unsaved queries by browsing this history file.
History of queries executed can be found by 2 ways mentioned in the following answer:
Recovering from MYSQL Workbench HISTORY
Recovering from AUTOSAVE file
https://stackoverflow.com/a/73464375/7397820