Sublime Text : SQLTools Connection without specifying a database - mysql

I'm configuring Sublime to run my SQL queries, I installed the SQLTools package and successfully connected to my host, however I need to specify a database and I don't want that, I want it to connect to all databases on that host , this in order for the autocomplete to work for all the databases, since if I connect to a specific db, the autocomplete only works for the Tables of that db.
enter image description here
When trying to omit the database attribute, the connection is not created correctly, so I suppose the database parameter must be there and I would like to know if there is a possibility of specifying that it take all.
PD: This is the way SQLTools is setting by default.
enter image description here

Related

Access denied for user 'test'#'%' to database 'db'

I'm trying to run the mysql/mysql-server docker image on a cloud container that I have, in order to connect from another container running another docker image and store data and what not in the database, as is normal.
So, reading which environment variables did what over at docker hub, I set the following variables as a test.
Connecting from the other docker image, should work if I configured everything, however, the logs says otherwise.
Access denied for user 'rolauser'#'%' to database 'test'
The line of my program that attempts to connect to the database is the following.
conn.connect("test", "confidential.hostname.here", "rolauser", "testtesttest");
I'm using libsqlpp as I'm working in C++, but the problem is unrelated to that program.
So, I have an idea of what could be going wrong. After doing some research, I have discovered that SQL servers, distinguish between users logging in from different hosts.
My thinking is that by setting a user and password via environment variables, the SQL server might be assigning this information only to rolauser # localhost. As I'm accessing the database from outside the container running the server, I don't have localhost as my hostname, thus not being able to access the database.
I don't know what else could be going wrong. I'm aware that I could try building my own image that runs a custom init file upon container startup to create the database, user and password for a wildcard hostname manually, though I'd like to know what I'm doing wrong first instead of going for a different solution.

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.

Can Coda get to my AWS database?

I've got an AWS EC2 instance, with the usual keypair access technique (and not password access), and am using Coda to do site development on it. I've been able to configure my .ssh stuff so that Coda can connect to the site's files, and I can see them in the Remote Files pane. However, I haven't been able to get through to the database. I'm trying to set up a MySQL pane with "Connect to MySQL Server via SSH", but, regardless of what I use for parameters in that panel, I keep getting one varient or another of "The SSH Tunnel has unexpectedly closed." Has anybody been able to get database access to work? I've got a phpMyAdmin installation working on the site, but I've kinda gotten use to the Coda interface... Thanks!
The trick is to use ~/.ssh/config. Use it to create an alias with all your settings (host, port, username, password, private key, etc) and then just point to the alias.
Helpful post: http://nerderati.com/2011/03/17/simplify-your-life-with-an-ssh-config-file/

Delphi and mysql - Unable to connent to server..maybe custom connection reqd

I am coding an application for my company wherein i want to parse the results of a mysql query and display them in my application but i am facing a problem conecting to the database.
the ip address of the server is : 172.30.192.20
and before i can ping it i have to add route on my pc something like this
route add 172.30.192.0 mask 255.255.255.0 172.30.192.56
where 172.30.192.56 is the gateway
Now whenever i try to connect 172.30.192.20 which is where the sql server is running my appplication instead connects to 172.30.192.56
i am coding the application in delphi and have used TmySQL
After this didnt workout i tried an application called SQLwave. I just entered the server ip address and was able to connect to the database without any problems. it seems sqlwave uses mydac which is why even i tried using it but using the default connection options and setting i was still not able to connect. it seems sqlwave uses a custom connection using mydac
i just want to know whats going wrong with my connection
I tend to use the ADO Components. Here's a small (simple) example you may want to try...
Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=myDataBase; User=myUsername;Password=myPassword;Option=3;
Above is a Connection String, using the MySQL ODBC 5.1 driver (available on the MySQL website if you don't already have it). Modify this to reflect your server address, database name, username and password. Paste this into the "ConnectionString" property of a TADOQuery.
Set this ADOQuery object's SQL text to something like
SELECT * FROM mytable
Where "mytable" is the name of an existing table in your database.
Now change the ADOQuery object's Active property to True.... see what happens.
As Mason suggested, you may simply be experiencing a connectivity issue, still you never know, my method may come in handy!
Good luck!

MySQL error "No Database Selected"

I am using LAMP on localhost. I can login which uses mysql db, get to the main page (data driven), but when i enter this particular page, its fine, but when i refresh the error is "No Database Selected" then one every page says so.
I restarted the Apache, MySQL server
Browsers FF,IE, Chrome all show the same errors, cleared cache too. At the same time other websites that use the same LAMP server works fine.
Now thats strange
All ideas are welcome.
Are the main pages using mysql_select_db("foo") and this particular one not?
When you are connecting with php, you are not selecting a database (or the select is failing). Is it perhaps using a variable which is not getting properly populated?
Somewhere in the code (PHP) the default database gets reset, probably on a shared database connection. I guess this is a bug in the product you use.
Try going through the code where it connects with database and tries to pull the data. Most of the times there is a configuration file which defines the connection attributes like username, password, database server, port and database to be used also.
for example in phpMyAdmin keeps the information in libraries/Config.class.php file.