View Database Tables From AWS in MySQL Workbench - mysql

I have successfully migrated my mysql database file to an aws mysql instance using MySQL Workbench.
I now want to test that everything is migrated properly. When I connect to the db using MySQL Workbench and run an sql query such as
SELECT * FROM Users
I get an error saying that no database has been selected. I'm thinking that I'm actually only connected to the server and not the actual database. Is there a method to connect to the actual db and view all the tables on the server using MySQL Workbench or possibly another tool.

You never connect to a database. A database (aka schema) is just an organizational construct within a database server (aka RDBMS). So, first you connect to that server, to establish the communication. Then you select a schema to work with. Either run a USE command or, in MySQL Workbench, double click on a schema node in the schema tree on the left hand side to make this the current default. You can also set an initial default schema in the connection settings. The current (default) schema is shown in bold in the tree:

Figured it out.
There is a small expand button in the navigator panel on the left which can be expanded and I can view all my tables, columns etc...

Related

How to replace PhpMyAdmin SQL table with local docker SQL table in PhpStorm

I'm using PhpStorm and am running a local WordPress Docker environment with persistent SQL database.
I can connect to my persistent SQL database using localhost fine.
Which I can the see all the tables in my local SQL WordPress database.
The problem I am having is getting my chosen table or tables into PhpMyadmin.
This is the context menu in PhpStorm when I right click on a database table.
Does anyone know how to do a direct replace like for selected tables.
For example I am just trying to replace wp_gf_form data with wm_gf_form data in PhpMyAdmin.
Any ideas would be great thanks.

H2 console shows tables of all schema for MySQL

H2 console can be used to connect to other databases too. For instance, MySQL.
However, when connected to MySQL, it shows tables of all schema and not just the tables of connected schema.
What could be the issue?
Using Version 1.4.199 (http://repo2.maven.org/maven2/com/h2database/h2/1.4.199/h2-1.4.199.jar)
MySQL server is running
Start h2 with java -jar h2-1.4.199.jar
Select and open “Generic MySQL” and open “bankdb” schema (JDBC JAR is latest 8.0.16 and located in same folder)
Logging into MySQL with H2
On left side, shows tables of all schema, including tables of desired schema. (Expected: show tables of only "bankdb")
I have seen this behavior with other multi-database tools, such as HeidiSQL. There is nothing wrong with seeing other schemas per se, so long as you can connect to your desired database from within the tool. Are the only three tables in the bankdb database account, customer, and transaction? If so, then it means that you did connect to the correct database. You might also want to poke around and make certain that the USE <database> command works properly.

mysql workbench connect with multiple database

I have two different instances on my workbench localhost and remote server instance shopify_data, (default schema sales_report). Now I want to fetch the data from table zipcode in localhost and other fields that are in another table shopify_orders in remote server shopify_data within sales_report.
The query looks like :
SELECT Name, billing_zip, Billing_Name, Billing_Address1,Billing_Address2, Lineitem_name, Created_at
FROM sales_report.shopify_orders
WHERE Created_at between '2017-08-31' and '2017-09-21' and Billing_Zip in (select zip_code from zipcode);
It gives error:
sales_report.shopify_orders does not exists.
How can I connect my local host instance with shopify_data instance and get data within the same query.
Thanks.
Deepak
PS: I don't want to import the shopify_orders into local host as the value keeps dynamically changing with each order and I don't want to repeat importing
It's not possible to access data stored on different servers in a single connection, with MySQL. You always open a connection to a single server and can work with DB objects available on that (provided you have the privileges for that).
I should add there's the option of federated tables. More precisly it's a storage engine, which allows to host data on a remote server in a local table, which then makes it possible to do joins with both local and remote data. But that requires to define such tables first and you cannot use FKs (and there are other limitations).
In workbench you can work with multiple databases on same server in crossing manner mean to say in query window of one database you can access other database tables also.
For this follow the following steps:
The database on which you are working on localhost create this as testdb on your remote server.
Create a mysql user "anydbuser" which can access all database of your server. In plesk this option come when user created from database selection dropdown choose ANY.
now connect testdb using anydbuser.
In query window you can try this query : select * from original_db_name.tablename;
you are able to access result of above db table into testdb query window

Why aren't changes in MySQL database being updated in WebMatrix Database viewer?

I have MySQL running on my local machine. I have created several tables in MySQL workbench and connected WebMatrix to the MySQL DB. All the tables are present, however one of them does not contain any data (but it contains data in MySQL database). I have refreshed in Web Matrix, redone the connection string etc but the data does not display. When I try to run the SQL that populated the database in MySQL, inside of WebMatrix I receive this error from the Database Manager:
Object reference not set to an instance of an object.
My SQL is too long to post here. Any suggestions?
Restarted MySQL service and refreshed in WebMatrix. Data is now present. Not sure what was causing the issues but is resolved.

TeamCity won't create its schema in SQL Server

I've installed a new TeamCity instance and just moved from internal storage to database (SQL Server). Followed the instructions at http://confluence.jetbrains.com/display/TCD7/Setting+up+an+External+Database and I know I've done the database part correctly as it wouldn't initially connect and I had to go back and turn on TCP/IP connections for SQL Server.
From the documentation I assumed that team city would create and maintain it's own database schema, but even though it's user is dbo the database remains blank - no tables, views or any other objects have been created.
When I try to connect to it in a browser I get "Database is empty or doesn't exist", and viewing the logs shows me "Schema contains no tables". I've obviously restarted the service and connected again each time.
Is there an install script I am missing? How do I get TeamCity to install it's schema?
When you are doing it like this, you will need to migrate the initial structure over to sql server. See here