I get "Open SQL Script" upon MySQL startup (in Workbench) - mysql

I have 3 connections configured in the MySQL Workbench and lately as soon as I run the workbench I get this "Open SQL Script" dialog.
Steps:
1) Right click MySQL Notifier (1.1.4)
2) Click on "SQL Editor..."
3) Expected: Workbench Home (1 tab open)
Actual result: the tab for the 3rd connection is automatically open and on top of that I get this "Open SQL Script" dialog.
Additionally I would love to be able to change the default connection that opens, but I could not find any of this anywhere.
Help is appreciated! Thanks,
Simon

Take a closer look where you are clicking in MySQL Notifier. For each instance MySQL Workbench (and hence MySQL Notifier) found there's a separate menu entry which you can use to open the application for. The notifier is just trying to help you to get quicker to some standard work. If you just want to open MySQL Workbench then don't use the notifier. Create a shortcut for it and put in a good place instead.
Update
In order to clarify look at this image:
As you can see there's more than one "SQL Editor..." entry (one for each connection in MySQL Workbench). But even if you only have one connection, the menu entry "SQL Editor..." is meant to open ... well... the SQL editor. In addition it asks for an SQL file you may want to open. That's just how it is designed. If you don't want that click Cancel. There's no dedicated menu entry to just open MySQL Workbench with the home screen. If you want that better place a shortcut to the application on your desktop.
Regarding a "default connection": there's no such thing as a default connection. You can pass in a connection name on the command line if you want to open a specific connection. You can use the shortcut you can create and add the parameter "-query " to it.

Related

MySQL Workbench Manage Server Instances

I successfully installed MySQL server (I can connect to it manually through the MySQL shell). When I try to establish a connection through MySQL Workbench, the test connection goes through as well. But when I try to view the server's info or interact with the server, an error message pops up that says, "Current profile has no WMI enabled." I have searched for a solution to this problem, and found a few threads like this one: https://www.quora.com/MySQL-Workbench-How-can-I-solve-the-Current-Profile-Has-no-WMI-enable-error-message. However, I just can't find the 'Manage Server Instances' dialog or button anywhere. I am running workbench version 6.3. If anyone has run into this problem then I would appreciate a workaround.
It's unusual that you get that error again. I haven't heard since years of such a problem. Anyway, the solution is still to configure the connection properly. That "configure server instances" link is very old (from WB 5.x). Instead look for the connection editor (titled: Manage Server Connections). You can open the dialog either via the main menu or the small wrench button on the homescreen:

How to configure MySQL data source for PhpStorm?

I have a legacy PHP project using MySQL. PhpStorm discovers that there are MySQL queries inside the project, and asks me to provide a data source for them.
This opens this window:
Yet I am totally confused on how to provide the credentials to my MySQL database. I expected a mask to enter my MySQL host, username, password and target database name. Yet I cannot find this in here.
How to configure a MySQL data source in PhpStorm?
To create a new source for your projet, click on the green "+" icon and select mysql in the list of drivers. It should display fields for database info including username and password.
You have to click on the green +, top left corner.
Then Click on MySQL, and you will be able to enter DB informations.

Advanced Installer- How to create MySQL user during installer?

Im ready to deploy my project and I'm using Advanced Installer to package it. My project does involved a Database connection. My goal is during installation I will have a dialog that will ask user to setup a username and password for MYSQL database connection (and perhaps other mysql server fields).
How can I achieve this using Advanced Installer?
Any suggestion is welcome.
Here is their user guide tutorial about how to run sql scripts during installation. Hope this is useful.
To Enter the your database credentials first you need design the dialog.to design the dialog you go under dialog option and create a new dialog by right clicking the any other dialog you need to click on the option called add dialog in add dialog you will get a popup box by asking which type of dialog where you need to select sql connection dialog click on that and you will get what you want on start up...
Go to "Custom Actions" page and create a new "Launch EXE with working directory" custom action with sequence under the "Install Execution Stage -> Searches" action group like this:
File Path: mysqld
Command: --install
Working: Path to mysql\bin\
Add a new "Launch file" custom action with sequence, scheduled after the above one, like this:
File To Launch: cmd.exe
Command Line: /c NET START mysql
Working Directory:
Run as Adminsitrator: checked
For configuring the MySQL Server you can use a BAT file as a custom action after MySQL server is installed.

SSMS Change Connection for Query Editor Window

Normally when I want to change the connection for a Query Editor Window in SQL Server Management Studio, I can select a new connection from the menus at the top - Query > Connection > Change Connection.
However, when I am working on cubes with an analysis services connection - and then open a saved SQL script (such as the underlying SQL view) the Available Databases combobox is blank, and the "Change Connection" and other 3 options in that menu (Connect, Disconnect, Disconnect all queries) are all greyed out.
The only workaround I have found to be able to run the saved SQL script, is to open a "New Query" from the SQL Database I want to access in the Object Explorer, and either copy my script into it, or reopen the script - which now opens as normal, with the new query's database.
It seems to be taking the last Query Editor Window's database connection as the default connection for any new queries - and when your last "query" is browsing a cube then it breaks? Does anyone have a fix to un-grey out the "Change Connection" option properly?
I am using SQL Server 2008 R2, and opening the saved SQL script by the File > Open > File menu
Luckily in SSMS 2008-R2, 2012 There is a change connection function. Placed just before the DB dropdown.
Or via menu Query>Connection>Change Connection.
Well, SSMS does not allow to manage connections easily (particulary, when you want to switch connections between servers). I have developed add-in for SSMS: SSMSBoost - it adds additional combobox to the toolbar with your favorite connections (you have to define them). In your case, after opening the script you will have to pick the right connection from this new combobox and it will be established. Addin is currently free.

phpmyadmin enable drop database statement

I was alerted by my hosting provider that I exceed my 1000 table limit. I have a lot of databases and would like to delete more at once. Unfortunaltley they don't have a multiselect feature so I decided to use a query in phpmyadmin.
When I try something like DROP database some_name I get DROP DATABASE statements are disables
Does anyone know if it's possible to enable them or a different way to delete multiple databases?
It looks like there is a phpMyAdmin setting that you need to edit in config.inc.php.
boolean $cfg['AllowUserDropDatabase'] (line 503)
show a 'Drop database' link to normal users
Yes, you can do it with the following steps:
Go to wamp/apps/phpmyadmin3.5.1/libraries
Open the file called "config.default.php"
Go to line 653 and change $cfg['AllowUserDropDatabase'] = false; to true
Restart the server to see the changes
For Windows XP users: if the effect is not reflected, exit WAMP through the quick launch icon and try restarting it.
Go to -> your_drive/xampp/PhpMyAdmin/libraries/ (Windows with XAMPP)
or
/usr/share/phpmyadmin/libraries/ (Linux with PHP/Apache/MySQL/PhpMyAdmin)
Open a file name config.default.php
Find $cfg['AllowUserDropDatabase']
You will find the value is False. Change it to True.
Linux restart apache2 in terminal /etc/init.d/apache2 restart (Linux) or XAMPP Control Panel restart Mysql
Without touching any config files
If you have your phpmyadmin open, on the left side you'll see a database icon right next to your home icon( if you mouse over it - 'query window' title will pop up ), click on it and the window showed will allow you to enter the 'drop query' without touching any config files( at least i had no problems, hope it will help ).
you will need to update file config.default generally phpmyadmin's libraries folder
line 653 (may very depending on version)
$cfg['AllowUserDropDatabase'] = true;
Xampp window
Method 1
Open Xampp
apache -> Config -> phpMyAdmin(config.inc.php) or config.inc.php
Add $cfg['AllowUserDropDatabase'] = true;
Adding line in config.inc.php
Method 2
Open C:\xampp\phpMyAdmin\config.inc.php
Add $cfg['AllowUserDropDatabase'] = true;
PhpMyAdmin throws the error “DROP DATABASE” statement is disabled”. “DROP” tab is missing on the PhpMyadmin Home page. To Enable the above tab in PhpMyAdmin follows the below procedure.
Go to XAMPP directory—–>PhpMyAdmin—–>libraries/ folder.
Open/Edit the file with the name “config.default.php”
Find $cfg['AllowUserDropDatabase']
You will find it’s value is ‘False’, Make it “True” and you’re done.
Refresh PhpMyAdmin Page or Restart MySql server and then open PhpMyAdmin.
I was able to do without modifying any of the above mentioned files.
Step 1
click on the database icon next to home icon
Step 2
on the right side of the screen select the operations tab
Step 3
Select the drop the database option and it should work[for me it worked even with the tables containing data
Drop the database and create a new one. To do so, go to phpmyadmin and select the database over the left panel. Then Go to 'Operations' tab on the head. Find the option to Remove Database at middle right. Click on DROP DATABASE and way to go...
did you try deleting the database by logging in to mySQL using SSH if you have not already..
sudo mysql -u yourmysqlusername -p (enter the password
when prompted.)
mysql> SHOW DATABASES; (find your database)
mysql> USE YOURDATABSETODROP; (CHANGE THE DATABASE)
mysql> DROP DATABASE YOURDATABSETODROP; (and you are done.)
Sometimes PhpMyAdmin throws very unusual error: ““DROP DATABASE” statement is disabled”.
In this situation the “DROP” tab can not be seen in PhpMyAdmin home page. You can get rid of this problem by doing the following process.
Go to -> your_drive/xampp/PhpMyAdmin/libraries/
Open a file name “config.default.php“
Find $cfg['AllowUserDropDatabase'] = false; and
convert it to like: $cfg['AllowUserDropDatabase'] = true;
Stop mysql server and Start again.
:) you can now able to drop the database.
Yes, you can do it with the following steps:
1. Go to wamp/apps/phpmyadmin3.5.1/libraries
2. Open the file called "config.default.php"
3. Go to line 653 and change $cfg['AllowUserDropDatabase'] = false; to true
4.Restart the server to see the changes
Restart the wamp ...Close wamp server and open again. :)
Enjoy!
If this happened on a MAC, the chances are you are not running within an administrator's account; you don't have permission to delete the directory.
In your finder menu bar click "go" and type the following: usr/local/mysql/data
Select/delete the directory with the same database you want to drop - you will likely get the dialog asking for the admin username and password to continue.
After you enter the admin credentials, the directory will be gone. Restart your session with the database and you will be good to go.
Hope this helps
if you are using version 4+ then you can simply drop a database just following these steps:
go to mysql admin
click database option (right side of your databases)
here you will get all the databases you have and now click the checkbox at the left side of the databases you want to delete
just the bottom of these databases you can see the option "Drop" so click the drop to delete the database permanently
I had to use another icon in CPanel (Databases section / MySqlDatabases) instead of (Databases Section / phpMyAdmin).
(... since my shared web-host provider disables the DROP DATABASE command, and initially limits access to command line and config files.)
select the database in phpadmin
click the operations button
show the remove database section
click the Drop the database(DROP). It show the alert box.
click OK.
I had problems with most of these approaches.
My installation is hosted so I don't have access to the PHP config files and the PHPMyAdmin interface is not displaying the "Remove Database" section mentioned above (under the Operations Tab). The icon in the corner didn't work either.
What I realised you can do is create a stored procedure to delete your table.
Go to "Routines", "Add Routine" and create a stored procedure with the single line:
DROP DATABASE databasename
When that's created you can execute it and the database will get deleted.
Go to \wamp\apps\phpmyadmin4.1.14\libraries
Open the file called "config.default.php"
Go to line 653 and change $cfg['AllowUserDropDatabase'] = false; to true
Restart the server to see the changes
I noticed the same problem when I was trying to drop a database (5.0.2 is the version of PhpMyAdmin I am using). In my case, there is no $cfg['AllowUserDropDatabase'] variable in the config.inc.php file and the default config file libraries/config.default.php has it false by default.
If you want to allow dropping a database temporarily, I would recommend just adding a $cfg['AllowUserDropDatabase'] = true; line in the end of the config.inc.php file (or change the false value to true instead if it's already there) instead of modifying the default value in libraries/config.default.php that some answers here recommend because as the documentation says, "the file is not intended for changes". After doing your thing, just delete the line altogether or set it back to false again.
Go to the left sidebar of phpmyadmin where there is a listing of your databases and select the specific database that you want to delete.
Having done that under the menu bar where there are several options such as query, sql, operations, etc choose structure.
When you do that it will give you a listing of all the tables of the DB and right below the tables there is a checkbox choose check all and on the dropdown after that choose drop.