What are these unexpected databases in my MySQL AWS RDS instance? - mysql

On my AWS RDS MySQL instance I have some databases I didn't explicitly create there (and have never seen on my local MySQL databases, or on other hosted databases I've worked with) and wonder what they are (and what I can do about them):
information_schema
mysql
performance_schema
innodb
The first three are filled with data that I don't understand (and are listed separately in my MySQL tools; e.g. I have no ability to control privileges for them separately), while the last is empty. Can I delete the innodb? What are the others (I assume I should leave them alone)?
Forgive what may turn out to be a naive MySQL or AWS question; I'm fairly new to both.

These are all normal.
Every MySQL installation has the mysql and information_schema databases. If you can't see them, then either you either don't have permission to see them, or whatever you're using to connect to the MySQL server is hiding them from you. Most newer MySQL installations also have performance_schema.
The innodb database on RDS isn't really a database, but it shows up in the list because of the way the design of RDS interacts with MySQL server's internal concept that each directory inside that datadir is assumed to be a database. Files that InnoDB uses internally are stored there, even though the "database" itself appears to be empty. Just disregard it.
The mysql database contains tables used internally by MySQL, including the grant tables and time zone tables, and some DBA tools in the form of stored procedures that are specific to RDS, which are required due to the restricted access that even the administrator account has to an RDS instance, when compared to a standalone MySQL server.
http://dev.mysql.com/doc/refman/5.6/en/information-schema.html
http://dev.mysql.com/doc/refman/5.6/en/performance-schema.html
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.MySQL.CommonDBATasks.html

Related

I need connection to an Access Database from a mysql stored procedure to update tables i already create in mysql db

The access database is on server in folder. I need to create a stored procedure to connect to the access database and update the table data. It can be truncate then an insert. It is connecting via stored procedure to the access database i cannot figure out. It has to be done via a job on a schedule.
MySQL (the Sun- then Oracle- owned product) lacks the plumbing to connect to external tables unless they're on other MySQL servers. That is, it only has a FEDERATED storage engine. So, with MySQL you'll have to find some other way to handle your requirement; a MySQL event or other stored code cannot hit your Access tables.
MariaDB, the MySQL fork, has a CONNECT storage engine. It allows the server to hit external tables via ODBC, so you can hit Access with it. MariaDB is almost entirely compatible with MySQL, so maybe you can replace your MySQL server with it. The CONNECT documentation says this, however.
...these table types cannot be ranked as stable. Use them with care in production applications.
To me, that warning means don't do it!. Especially with a busy business-critical application (like a credit department might use) you don't want even a little bit of instability. If you truncate a table and then the reload fails, you'll be able to hear users yelling from the next county.
Your requirement is, I believe, to extract the contents of one (or more) Access tables and import them into a MySQL table. That kind of operation is called extract-transform-load etl. It seems you use SSIS for the purpose. That should work, because SSIS can connect to Access (of course) and to MySQL via the Connector/net or Connector/ODBC drivers.
But, scheduled SSIS packages get run from SQL Server database servers. You didn't say you have one of those at your disposal. If your org does have a production SQL Server instance, you can put your Access - to - MySQL package into it.
Otherwise you will have to figure out a way to run your scheduled etl job without relying on a database job (or event, as they're called in the MySQL world). For that you'll use the Task Scheduler on Windows, or a cronjob on a UNIX-derived OS like Linux or FreeBSD.
I bet you can do this work reliably from a Windows PowerShell script or a Linux shell script.

how to backup in rds aws?

Quick help here...
I have these 2 mysql instances... We are not going to pay for this service anymore; so they will be gone... How can I obtain a backup file that I can keep for the future?
I do not have much experience with mysql, and all threads talk about mysqldump, which I don't know if its valid for this case. I also see the option to take a snapshot but I want a file I can save (like a .bak).
See screenshot:
Thanks in advance!
You have several choices:
You can replicate your MySQL instances to MySQL servers running outside AWS. This is a bit of a pain, but will result in a running instance. http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Exporting.NonRDSRepl.html
You can use the commandline mysqldump --all-databases to generate a (probably very large) .sql file from each database server instance. Export and Import all MySQL databases at one time
You can use the commandline mysqldump to export a database at a time. This is what I would do.
You can use a gui MySQL client -- like HeidiSQL -- in place of the commandline to export your databases one at a time. This might be easier.
You don't need to, and should not, export the mysql, information_schema, or performance_schema databases; these contain system information and will already exist on another server.
In order to connect from outside AWS, you'll have to set the AWS protections appropriately. And you'll have to know the internet address, username, and password (and maybe port) of the MySQL server at AWS.
Then you can download HeidiSQL (if you're on windows) or some appropriate client software, connect to your database instance, and export your databases at your leisure.

What exactly is a connection in MySQL Workbench?

I am new to databases, have done my basic "homework" regarding the theoretical part, and set about using MySQL Server through MySQL Workbench.
I have created four "connections" which appear on the Workbench homescreen dashboard, and I have also created some tables. But when I login through any connection (using user name and password), I can see all of the tables that I have created. So can anyone please tell me what is the point behind multiple connections then? What exactly is a "Connection" in MySQL Workbench?
I tried googling it, searched it on StackOverflow, and even referred the user manual of MySQL workbench, but got no answers.
Each MySQL connection contains its own set of definitions. For example, the connections might connect to different MySQL servers, or the same MySQL server with different usernames, or enable SSL for one, or you might set up a connection to a remote MySQL server using the SSH options, and so on.
As for multiple connections to the same local MySQL server, you might have one connection using "root" with another using a less privileged user. Depending on how you set up the users, they may (or may not) both have rights to see and use the same databases (information).
So to summarize, connections simply connect to the MySQL server. If two connections use the same exact information then the results will be identical. However, that is not a common use case.

multiple machine MySQL through Workbench

I have recently started using MySQL Workbench, hence I apologise if this is not the proper platform to ask this question. I tried to figure out the solution of my own, but could not find any appropriate one.
Here is my situation: At my workplace, we have a huge set of data about the operational and financial figures such as sales, employee, profit, etc for European companies spread over past 7-8 years and new data keeps coming regularly. However, the problem is we work from different remote locations, me in one city and the other two colleagues in a different city. Normally, we share our work files (.xls/.doc) etc through Dropbox. So, we thought of creating a database in MySQL wherein we all can submit/edit/add this data so that we can filter and analyse this data on several ways once the collection is complete. And we plan to use and access it thereafter. We believe that this is ease a lot of our work. So all I want to know is: can all three of us collaborate simultaeousy (in order to add or edit the data) through workbench Server administration, like the way we collaborate our work through Dropbox? I want to be the host (like the administrator) and then want to allow the access to my colleagues.
Thank you for your time and answer. You may also refer me to any site or link to read more about it.
I think you are a bit confused about what MySQL Workbench is.
MySQL workbench is just a data viewer and administration tool that connects to a MySQL server, there's no data "stored" in MySQL workbench, all the data is stored in the server.
MySQL workbench can:
Connect to a MySQL server
Send SQL instructions and show the results: You can create and drop databases, send SQL queries, create and execute stored procedures and functions... all assuming you have the right privileges.
Perform administration tasks: You can create and drop users, grant or revoke permissions, etcétera
But the fact is: all is stored in a MySQL server... so the answer to your question is: Yes, you can work simmultaneously with your colleagues, if and only if all of you can connect to the same database server (as Mike W commented).
Addressing your comments, and clarifying more details:
MySQL is a database server. When you install it in a computer, all data is stored in that computer (aside from replication and other fine details). You should make regular backups of your data (MySQL has tools for that, one is mysqldump). If you want to access the data stored in your database server, you can do it:
By ussing the command-line client,
By using MySQL workbench or another GUI client program, or
By any program that can connect to the database server (via ODBC or specific libraries).
Focusing on MySQL Workbench, and addressing your specific question: If your machine breaks down, you can install the MySQL Server in any other machine, and load the backup into it. You will have to configure that new machine so that any of your coworkers can connect to it (that may imply that a new set of connection parameters is created).

mysql databases

could you guys please explain for me HOW these databases ARE CREATED :
mysql
phpmyadmin
information_schema
performance_schema
I know it's a novice question, I might GUESS the answer for some of them, for example "the reason phpmyadmin database is created" IS because I installed phpmyadmin and this database was created alongside . That's not for sure, so I just need some clarification.
Thank you !
Mysql is a database server. It serves access to databases. It runs on a machine as a service.
Phpmyadmin is a php based tool you install for managing mysql from a web page.
The last two are databases that can be created by an application, such as phpmyadmin, for storing schema information about the rest of the database or tables of a database.
These are the standard set of databases shown when you execute SHOW DATABASES on a clean MySQL install.
mysql - this is created at install of the MySQL server, either by the package management system of your operating system or the script provided as part of the MySQL package
information_schema - meta database, it does not exist on the disk
performance_schema - meta database, but it does store some files on the disk
Any other databases are user/application created.