I am using the Azure web app with PHP 7.3 stack. In my project, we have the feature to sync from mobile to web and for that, we are using the SQLite file. And for other modules, we have a MySQL database.
The mobile app sends the SQLite file and we stored it in the directory. But we try to make a query to the SQLite with PDO then it throws the error that the database is locked.
I tried many solutions from the other's answer but not get success.
This has to do with permissions of the underlying storage mount.
One option you could try is mounting an Azure File share and persisting the database there, see https://learn.microsoft.com/answers/answers/320889/view.html. The best option however is to utilize a cloud database such as Postgres or MySQL for Azure.
Related
I'm working on a project to create hybrid SQL database per tenant model. While we were able to replicate the on-premise databases to databases in Azure. I'm not able to find a way to continuously sync both on-prem DB and cloud DB (We cannot use data sync agent or transaction replication). We are looking for any other alternatives that we can try to achieve our purpose.
Also, how does synchronization works when the internet is down and cannot sync with cloud?
Sorry for my ignorance since I'm new to this field.
Thanks.
why can't you use data sync agent? It can be installed in other machine that has access to the database and internet.
Our Company working on a web App in java that combining with spring framework. For database side of application we use hibernate and our database is postgresql. I am on of developers and recently I have this strange problem only on my computer. retrieving data from database in our web application is so slow. there is not any common problem about slow query because when I run a query inside the database directly by postgresql query tools , there is not any slow retrieving problem.even I used one of my coworker's system as a database server.so the web application deployed inside my computer and the database server was inside another computer and strangely I had no speed problem. The data retrieved from database through web application was very fast!!! What's going wrong? is there a problem about my hard?
For security reasons i have a heroku project that should access a heroku postgresql database but user can only access some tables.
How can i do this on heroku postgresql?
The only way i can think of doing this is:
creating a web project with a postgresql dev addon. this will create a new db in a HEROKU_COLOR_X url;
creating another web project with another postgresql dev addon multiple times so that this HEROKU_COLOR_* is same as previous HEROKU_COLOR_X;
login in HEROKU_COLOR_X with user_2 (admin) create some tables as user_2 and grant access to user_1 for some tables only.
this will result in same db host (HEROKU_COLOR_X) and 2 user/pass (user_1 for web project access and user_2 for db full access).
.. but is there any better solution?
best,
I'm not sure about your theory but unfortunately, the Heroku Postgres docs state:
You cannot create or modify databases and roles on Heroku Postgres.
The SQL below is for reference only.
I'd love it if this restriction could be changed or worked around as granular permissions are a security essential.
gerryster's answer is no longer accurate as Heroku have now released support for multiple roles https://devcenter.heroku.com/articles/heroku-postgresql-credentials This should cover the OP's use case of restricting access to certain tables.
I'm developing an application and hosting it on Heroku. For now, I want to use the free shared database solution.
My problem is that I can't access the database.
$ heroku pg:psql
! Cannot ingress to a shared database
I've read elsewhere that I can't connect to shared databases via psql.
I can't seem to find any information on that on Heroku's Dev Center, so this leaves me with the question - how can I edit or change or do anything with my database?
If you're happy to use a beta addon then there is the Heroku Shared PostgreSQL 9.1 addon (https://addons.heroku.com/heroku-shared-postgresql) which will permit you to ingress to your database.
However, any changes to your database are usually best done with scripted migrations (in the Ruby on Rails world) rather than connecting to your database to make changes.
If you're more familiar with mySQL then there are a number of mySQL addons which permit direct access also with normal mySQL tools.
I have an installer wizard thing called 'install creator'. I want to include my mySQL database into the installer or find another way that the user, upon installation, can just use my database. Prob is-not everyone has MySQL installed on the computer and even then, the user doesn't know the name of the database or my password. Somehow the database must be created automatically upon install, and for my purposes, some of the tables created. How can one do this. Thanks
If you are just using MySQL as a local storage engine, as it seems to be what you are doing, then you should consider using Sqlite with JDBC, instead of MySQL. MySQL is really intended to be used on a server, where information from multiple users is stored, and where the database is accessed only indirectly through the programs that you create that run on the server. You could, in theory, package up MySQL and MySQL Connector/J which lets JDBC talk with MySQL; however, MySQL is a pretty big beast, and I don't think it's nice to do that to your users (also, don't forget that they might already have MySQL installed, and if you were to install MySQL for the first time, you would effectively be forcing them to use your root password). Unlike MySQL, sqlite is intended to provide the structure of SQL for use with lightweight, local file storage.