No error message displayed on MYSQL Workbench latest version - mysql

I am running the latest version of MYSQL Workbench on a clean ubuntu 14.04 install, using the ubuntu package version.
When I run a valid query, it works fine, e.g.:
select * from users;
At the bottom of the window in what I would call the 'Status Bar' it says 'Executing Query...' for a few seconds while the query runs, and then changes to 'Query Completed' and displays the results.
So far so good.
If I then change the query to something invalid, e.g. :
select * from invalid_table;
The status bar says 'Executing Query...' and stays that way. I cannot see the error message reported anywhere.
If I run the same query in a terminal I get:
mysql> select * from invalid_table;
ERROR 1146 (42S02): Table 'mydb.invalid_table' doesn't exist
Surely the error message should show in workbench?
Am I missing something here?

The error is displayed within the Output History panel, at the bottom. It's possible your bottom panel is deactivated, or hidden. The linked documentation includes annotated screenshots and examples.

Did you hide the output panel?
View->panels -> show the output area
Or you may drag the output panelmini. You can move your mouse above the status bar , the mouse will turn to double arrow icon, then drag it and the output panel will show .

Related

How do you execute a query in Sequel Pro?

I want to execute a query in a MySQL DB using Sequel Pro, but I do not see a Run button.
How do I execute my query?
Use ⌘+R to execute the selected Query.
Alternatively, use the dropdown that appears at the bottom right of the query editor and select Run Current or Run Previous depending on where your text cursor is.
Based on Keyboard Shortcuts:
Run all queries ⌥ ⌘ R
Run current query or selection ⌅ or ⌘ R
Use the drop down button on the right side, underneath the textarea.
Should have the following options:
Run Current Query
Run All Queries
Came here to find ⌘ + return to execute a query (like MySQL Workbench).
Found that I can map using mac Key bindings with the names of Run Current Query and Run Previous Query.
If you want to do it via terminal it would be (untested):
defaults write com.sequelpro.SequelPro NSUserKeyEquivalents '{
"Run Current Query" = "#\\U21a9";
"Run Previous Query" = "#\\U21a9";
}'
Note: you may have to restart the app.

Why phpStorm marks an error on valid query

I have a query:
$this->source->exec("UPDATE `account` AS `m1`,
(SELECT `m2`.`id`
FROM `account` AS `m2`
WHERE `m2`.`userid` = ? AND `m2`.`demo` = 0
ORDER BY `m2`.`date` DESC LIMIT 1) AS `m2`
SET `m1`.`default` = '1'
WHERE `m1`.`id` = `m2`.`id` AND `m1`.`demo` = 0", $user_id);
Now, phpStorm is trowing an error for the ORDER BY in the subquery. The query works perfectly when the code is run. I set MySQL as the SQL dialect in phpStorm.
The error is:
GROUP or HAVING expected, ORDER got.
How can I fix this error?
actually phpstorm recognize this symbol as invalid key when using with php, cz of php doesn't know aboutsql` use
If you check you sql with index.sql its show like this (without errors)
so just create test page with test.sql and copy your sql code.
then above of the code you can see orange color tab shows(check below image)
click Configure Data Source
and click MySQL in left side panel(below image)
and then click download in bottom of the panel(below image)
It will download file(s) relevant your versions
and click ok.
now delete the index.sql and you can use as same without error.
I have tested and work fine to me

What does it mean when the console displays ->?

Rookie question.
I was performing some mysql processes, and then the console displays an indented -> as in the image below, instead of the normal console prompt:
What does that mean? I can't do anything with it there.
Thank you!
Means that the sentence is not completed.
To end a sentence inside a mysql session, you have to type ;⏎.
By the way, you couldn't do a cat inside a mysql session.

CaseSenstive Table names

hi there i made track star application and everything works fine except for one issue that i face error
CDbCommand failed to execute the SQL statement: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'devnmark_root.AuthAssignment' doesn't exist. The SQL statement executed was: SELECT *
FROM 'AuthAssignment'
WHERE userid=:userid
now this was automatically generated by Yii when i checked for if(Yii::app()->user->checkAccess('createUser',array('project'=>$model)))
18 {
19 $this->menu[] = array('label'=>'Add User To Project','url'=>array('adduser', 'id'=>$model->id));
20 }
then i went to phpmyadmin and executed this query manually
SELECT * FROMAuthAssignmentWHERE userid=4 and there is error which says same that table does not exist.
if i use small case letter for table name then no error.
i executed same query on local wamp 's phpmyadmin same query does not show any error there so this is clear that there is error with my sql .any idea what can i do to solve?
I suggest you hitting up SQL_MODE documentation for setting your final options. http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html
For testing you can just do a:
SET sql_mode = '';
Or adjust your command line:
--sql-mode=""
You may try to set the system variable *lower_case_table_names* to 1.
My local application was developed under Windows, howerver production is under Linux and I caused the same problem.
For me it happened because of case sensitivity - table AuthAssignment in database was actually authassignment.
I have found two options to solve it:
rename database table from authassignment to AuthAssignment
or
edit config file component section:
'components'=>array(
...
'user'=>array(...
),
'authManager'=>array(
...
'assignmentTable'=>'authassignment' //THIS LINE SOLVED MY PROBLEM
),
I had the same problem of non-existent authassignment table, I had forgotten running the rights installation which in my case was by following URL i.e.
/index.php/rights/install
and then the setup was like a breeze and self explanatory :)
For me this answer helped the most: original source.
In the authManager in config/main.php you can add lowercased names of the tables like this:
'components'=>array(
'authManager'=>array(
'defaultRoles'=>array('guest'),
'class'=>'RDbAuthManager',
'assignmentTable'=>'authassignment',
'itemTable'=>'authitem',
'rightsTable'=>'rights',
'itemChildTable'=>'authitemchild',
),

Executing Line/Multiple Lines Only in mySQL Query Browser

I already used Microsoft SQL Server 2005 and found really easy to execute single/multiple lines of an sql query.
Example:
insert into tablea
($vala, $valb, $valc)
values
($vala, $valb, $valc);
insert into tableb
($vala, $valb, $valc)
values
($vala, $valb, $valc);
How can I execute the second part only? In MSSQL i will highlight the second insert statment and press F5. How can do this in mySQL?
The problem is that you must be trying to execute your query from a Query Tab rather than from a Script Tab. Go to File -> New Script Tab and input your multiple statements there. Next click the execute button... that's it.
Hope it helps!
Machi
You can do this. When you have logged into MySQL query browser, and you write two complete statments such as:
select "hello world";
select "second query";
You will notice two blue dots on the left side of the window they are left of the line numbers. By default it will try to exec the first command. That might be why you see one command with white background and all the others with a grey background. The command that is white, is highlighted and it is the one that will be executed. You should be able to just click anywhere inside the second query to highlight it and then click the lightning bolt button (execute) to run it.
You can do this in MySQL, but you have to use mysqli. Click here for details:
http://php.net/manual/en/mysqli.quickstart.multiple-statement.php
In workbench, make sure the cursor is in the statement you want to execute and hit Ctrl+Enter.
Ctrl+Shift+Enter will run all statements consecutively in the window/document.
In addition if you have selected a statement, Ctrl+Shift+Enter will execute the selected statement only.
Does selecting the second part and "EXECUTE" help? If not, then I am not sure if such a use case is supported. You might want to try MySQL Workbench though.
well the issue here is that if i write the queries :
select "hello world";
select "second query";
and Execute it gives error -- when i select/highlight any one of them and execute it gives the same error -- so i have to either delete one of the queries or comment it out or use the script editor which doesn't work for me and lot of other users who have use MS SQL 2000,2005.
If there a solution for this -- ideally it should execute the query i select .
Just an opinion
Rohan