How split MySQL database into multiple host, keeping remote references - mysql

I'm developing a web application that will handle user and data.
One requirement for this project is that the data collected must be stored in another host than the one with webserver.
My first idea was to deploy a single database with user data, login info and preferences all together into one host and keep the webserver into another one, using remote connection for each query. But this is not required, only user data must be stored in a remote host and other info can be locally accessed by webserver.
Does exists a way to manually split a MySQL database in two different host leaving to the framework to keep remote reference and coherence?

I think you can do this:
Can MySql 5.0 have a view of a table located on another server
In the local DB define the view of the table you want to be remotelly hosted.

Related

how to create MYSQL User for tableau connectivity only

I want to allow MYSQL connectivity to business users on tableau without creating a DB user i.e. without allowing direct access to the database through the MYSQL workbench.
right now I have a MySQL user with grant access on only one database to connect through tableau. But business users can use this user to explore data through workbench and run queries, which is not ideal.
Is there a way to give MYSQL database access ONLY on tableau and not any database tools like workbench?
There is not such an option for it. But you can create/define user roles with restrictions on DB/table levels in MySQL or you can create two database(on same machine or another machine), one is Main(Primary) and other one for Tableau only, so if any Tableau users access the new(separate) database from any other application, they will have limited data(only which is using for Tableau dashboards).
So I found a solution for this and here it is, in case someone else has this issue.
I just published a live connection to my database table on tableau server, and embedded user credentials in tableu. This way anytime a user wants to use the data source they just need to select from published data sources. But we wont have to share user credentials with them, that resolves the issue and they wont be able to log in using any credentials from any database client.

2 way sync of MySQL databases

A web application runs both on live and local server with live and local database server. Users use live server to add the data, whereas internal staffs use the local application to update the data. After some time, both of these databases have to be synchronized properly without loss of data from live or local database server. I don't want an exact replica of live database in local database or vice-versa but databases need to synchronize values which have been entered in it.

MySQL Workbench - Define database in connection settings

I was wondering whether there is a way to define a specific database in the connection setup of MySQL Workbench (I know this works with other database software). Sometimes I have a lot of different databases on one server and I only want to access one with one connection. Can I specify the database in the connection settings somehow?
YES, On the home tab Click the + in MySQL Connections. And put the database name in the Default Schema: when you fill in all the usual info about ip address etc
Now if you only want to see the one database, then create a new MySQL user account and only allow this new account access to this single database. Then change the connection to the database to use the newly created MySQL account.
I guess you are seeing all the databases because you are using the root account.

data replication and master

I have a web based system in php that works locally in multiple places and in each place has a local database in mysqli.
Also my system in every place connect remotely to another database that get all of information from specific tables of local systems as an example when you insert a record in any place,this record insert to remote database ,too. and so on ,to tell summary sync information from local to remote database.
schema of the system
Now I know replication can be a good idea for this.
but I don't know when my remote database has a problem and my system can't connected to remote database how to apply changes in local database to remote database?

How to connect with mysql of external server to generate reports in Pentaho

I want to generate reports with an external database of mysql.
Not my localhost database.
I want to generate report of mysql database of external server.
Have you ever used the Data Source Wizard?
From the Pentaho User Console, select File -> New -> Data Source.
Name the new data source.
Select "Database Table(s)" as the type.
Click the little plus circle to add a database connection.
Select the database type. Fill in host name, port, login information, and any other options. Test it if you like.
Hit Ok.
Continue with Data Source Wizard.
In order for MySQL remote access to work properly, the following needs to happen:
You have to make sure that MySQL is utilizing TCP bind on top of socket binding. Also the address it is binding to has to be accessible outside the machine (ie. not localhost)
A user needs to be created with the proper hostname and database access. DO NOT USE THE ROOT USER.
OR
You have to connect to MySQL through an SSH tunnel, if it is bound to localhost on the system, and a user needs to be created with access to the database (you shouldn't use root).
If you're not sure how to do this, I recommend you talk with your systems admin, or if this is hosted on another location, your hosting provider. In general I use the secondary option, but it's also the more difficult to setup for some users.