No changes detected in mysql - mysql

I been using mysql 5.6 for a while now,
Sometimes when I make some changes in the procedure , table or function and try to save them MySQL refuses to save them and shows a error message like "No Changes detected". here I am not talking about changing cases or managing spacing. Even If I add some new column and add new condition in the procedure its unable to detect the change
Can anybody help me out with this MySQL bug
I have even upgraded to MySQL 5.7 but still problem persist.

I overcome this bug by removing the "DEFINER=root#localhost" part from the editor and then click on "Apply". It works 99% of times.
Eg: For a function or procedure, below is the declaration you see at top. Just remove the DEFINER string as described above and try it.
CREATE DEFINER=root#localhost FUNCTION/PROCEDURE

Since this is not a MySQL server error response, I assume you are trying to update your procedures with the MySQL visual tool workbench (http://www.mysql.com/products/workbench/)
I found bug reports on mysql.com pointing out similar issues. http://bugs.mysql.com/bug.php?id=68434
Those might be fixed with the latest version 6.0 of MySQL workbench.
If not, a possible workaround would be to drop and recreate procedures.

If you are using MySQL Work bench this means that the SQL script is identical to the copy in the database.
This generally happens for 1 of 2 reasons
Either the Files are Identical, or the script failed to parse as valid SQL and its has then defaulted to the original script. if you check the message log then the second one should say
Action:Apply changes to [scriptName]_SYNTAX_ERROR
Message:No changes detected
this can be confusing as the Commit Dialogue only displays the message not the action

Related

"Configure TableAdapter tbl_users failed. Specified cast is not valid." - Error When Editing/Creating TableAdapter?

Bit of a back story, I was using MySQL Server 5.X on an old server. Retired server and migrated all data to a new server with MySQL 8.0.11 (now 8.0.12) installed. Used Legacy authentication to reduce issues.
This seemed to work and all my programs open/ran as expected. I've been editing them and publishing without any issues as well, however in that time I have not had any reason to change any of the data sources.
I've gone to change the data source today though and can not get it to work for the life of me.
If I try and make any changes I get the error "Configure TableAdapter tbl_users failed. Specified cast is not valid.". Obviously the table name varies and this happens regardless of which table (even trying to add a new table that I've just created).
It seems to work though, but on closer inspection, the delete and update commands are not created which means if I try and run the application I just get errors.
I've currently got:
Visual Studio 2015
MySQL Connector Net 6.9.8
MySQL for Visual Studio 1.2.7
Thanks in advance for any help/ideas.
#A Tyler. I suggest trying to update the MySQL for Visual Studio and MySQL connector to the newest versions. Have you tried that?
I think this issue is somehow related with the one described here.
https://bugs.mysql.com/bug.php?id=31338
This bug dates back to version 5.1 of the connector and VS 2005... should have been fixed right now, but the symptoms are very similar.
Maybe you found any other solution?
Update:
I 'slept' with the problem and found a workaround on the next day. This does not really solve the issue but made it possible to continue with the project.
I went to the 'properties' window of a table adapter and manually edited select and update commands there. It caused the table adapter to reflect these changes and I could use the new table field in my program. For me, this is good enough.

Writing many MySQL (in vsCode) queries in one file. How to avoid writting 'USE DBaseName" constantly?

I'm learning SQL / MySQL using WAMPSERVER and the MySql extension for vsCode, so that I can write, comment and keep the code in the vsCode editor, instead of sending volatile queries with the command line.
This morning I created a database by right-clicking a database / New Query:
After creating it this way, I was able to create code that I run without having to write USE DBaseName before the selected lines, as in the selected three lines you can see below:
Yet, after restarting my laptop at home, the same code will not run. It returns the usual
undefined
Error: ER_NO_DB_ERROR: No database selected
unless I write the USE statement, as in the last group (4 lines) of code. So I have to write that every time I want to try a query...
Why did it work this morning and not now? How can one run queries without having to constantly write USE DBaseName?
(links to explanations to further understand the underlying mechanism are also very welcome...)
EDIT: posting image of server in vsCode to answer comment:
I'm using a local server (pic below) which hasn't changed since this morning...

typo3 7 LTS installation database query failed

I get following message when trying to first install the typo3 7.6 LTS version.
I have tried several new databases, they are all empty and I still keep getting this error:
**Error:
Duplicate entry '1' for key 'PRIMARY'**
You could try to empty that table by hand and execute the shown sql query by hand. Maybe you can identify the error.
You also should compare the definition of the table in question.
maybe your mysql(?) has some problems creating the tables as expected.
I was able to access the backend by calling the URL, even without making it to step5 (100%) the backend opens up. Step 4/5 would reload and redirect so I tried logging into the backend without finishing to the last step. It seems to work.

PhpMyAdmin SQL Query Code Reverting Back To Old Code

I'm trying to change the SQL query under the SQL tab in PhpMyAdmin but the old code keeps coming back every time I navigate off that page (and thus, giving me an error message again). How can I stop it from reverting back to it's old erroneous code? I have the new code at the ready. Is there some sort of setting I need to tweak?
Actually, I don't really need any code here at all, unless it's required. I'm new to PhpMyAdmin and just want to set it up so that I can follow along with a video tutorial.
When I try to click on the Databases tab
The old code in the SQL tab. Keeps coming back...
Note: The code was changed to that shown below that works. But it "reverts" back somehow. Good code:
It appears to be a version incompatibility. Your screenshot shows you using MySQL version 5.7 with phpMyAdmin 4.2; this is not supported and guaranteed to not work properly. For use with MySQL 5.7, you should use the latest phpMyAdmin (which is currently the 4.6 branch; 4.6.4 was released on 2016-08-16).
For more information about version compatibility, see the "Requirements" section of the documentation included with each download, or the information listed with each version at https://www.phpmyadmin.net/downloads/

SQL Server: stored procedure saves with errors

I am using SQL Server 2008 and SSMS 2012. I have a stored procedure that references a table that does not exist. The editor displays red underlines on the offending table to indicate that something is wrong.
However when I execute the query, I get the message
Command(s) completed successfully.
This is extremely annoying. I also connected to the engine from another machine and it experienced the same problem, which implies its on the server, not ssms. Is there some kind of setting on the database that determines whether the database checks the syntax of stored procedures? PLEASE HELP!
Clarification:
I know that the syntax is wrong. The problem is that SSMS allows me to execute the CREATE or ALTER statement without error even when it references a table that does not exist. I want it to fail. Usually it does, but for some reason it suddenly stopped giving errors. I want it to give me errors. How do I do this?
Your syntax is fine and that is checked when you create the stored procedure. The existence of tables is however not checked until the stored procedure is compiled and that happens when the stored procedure is executed.
What's going on is that the IDE in the management studio hasn't had the schema model refreshed. Since the local instance of SSMS doesn't know the table exists, it throws a redline under the table name; when you actually run the sproc/query, the code sent to the database evaluates properly and runs.
To refresh the SSMS local data, try pressing Ctrl-Shift-R, as described here.
Edit:
You might want to look into Deferred Name Resolution
You will not get an error message when you CREATE or ALTER, but you can check your SPs for missing dependencies with a script afterwards.
Please check my answer to the related question here (I just post a link to avoid duplication):
I'm looking for a reliable way to verify T-SQL stored procedures. Anybody got one?