How do i create and manage my database for online website? - database

I imported my Symfony project on heroku to see how it will be on production. But i got this error:
2022-03-18T13:30:30.230251+00:00 app[web.1]: [18-Mar-2022 13:30:30 UTC] [critical] Uncaught PHP Exception Doctrine\DBAL\Exception\ConnectionException: "An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused" at /app/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php line 103
2022-03-18T13:30:30.230298+00:00 app[web.1]
So it means that they can not connect to my database, it seems normal since the DATABASE_URL in the .env file is for the localhost(phpmyadmin, root, pwd ="", etc). I have seen that we can add add-ons and i tried to add one for database(ClearDB) but they asked for Credit card(but my one is not available now). I am now looking for a database manager so that i can create my database, get the database's parameters(username, password, etc.) and add it to the heroku app so that i can do my migrations and launch the wesbite.
Is this possible, with which software ?

Related

Failed to connect to Database - Setting up GCP app engine

I'm trying to setup an instance on my phoenix app. I'm actually able to generate the app but I'm getting an error when trying to connect to the DB:
ERROR:
21:11:31.017 [error] Postgrex.Protocol (#PID<0.2223.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (/tmp/cloudsql/statcasters:us-central1:statcastersdb): no such file or directory - :enoent
I'm not sure what is wrong? The file seems to exist but it seems to say it doesn't:
prod.secret.exs:
config :statcasters, Statcasters.Repo,
username: "postgres",
password: System.get_env("DATABASE_PASSWORD"),
database: "statcasters_prod",
socket: "/tmp/cloudsql/statcasters:us-central1:statcastersdb",
pool_size: 20
I'm not sure what more information I can give? Does anybody know what I could be missing here?
There are 2 flavors of App Engine so please see the instructions linked here: https://cloud.google.com/sql/docs/postgres/connect-app-engine
The socket name appears to include a redundant "/tmp" prefix and should start with "/cloudsql/..." for App Engine standard.

WLP :: Worklight :: Can't install runtime

I'm using Worklight 6.2 server edition and I can't deploy a working runtime (of other environments) on my server.
I'm using webpshere liberty profile v8.5.5 and when I deploy the runtime via GUI it says success and on server.xml I can see the new configuration for the app.
However when I go to the worklightconsole I don't see my runtime to upload the app.
On messages.log there is a error regarding JMX connection.
The quoted error is
Failed to obtain JMX connection to access an MBean. There might be a JMX configuration error: No JMX connector is configured
I'm refering this because I've seen some post on SO saying that these issues might be connected. However I have the restConnector-1.0 on my WLP features.
Reference: No runtime on my Worklight 6.2 Console after installing analytics
On messages.log there is some other things that I found interesting, like the correct start of the runtime I've deployed
[11/12/14 5:50:45:177 CST] 00000012 com.worklight.server.bundle.project.JeeProjectActivator I FWLST0002I: ========= Project /HelloWorld started. The project WAR file version is 6.2.0.00.20140922-2259,running on server version 6.2.0.00.20140613-0730. [project HelloWorld]
and two erros while starting my server
[11/12/14 5:50:49:911 CST] 00000012 SystemErr R 24 WorklightPU WARN [Scheduled Executor-thread-1] openjpa.Runtime - An error occurred while registering a ClassTransformer with PersistenceUnitInfo: name 'WorklightPU', root URL [file:/opt/IBM/WebSphere/Liberty/usr/shared/resources/worklight/lib/worklight-jee-library.jar]. The error has been consumed. To see it, set your openjpa.Runtime log level to TRACE. Load-time class transformation will not be available.
Second error:
java.lang.RuntimeException: Timeout while waiting for the management service to start up
I don't know what these are but I think it might be related to my problem and this errors eventually appear when I start my server.
Does anyone have any tips for troubleshooting this issue?
Thanks in advance.
This is a known issue from Websphere.
There is a APAR to fix that, a workaround is to restart the server with the --clean option to force a refresh onto the shared libraries.
http://www-01.ibm.com/support/docview.wss?uid=swg1PI17830

Heroku database push operation

To load a database which runs now on the my computer, SQL Server 2012 and Windows, I have installed Git Bash, taps and Heroku.
Now, whenever I wrote the command
heroku db:push --app myapp
it gives the same error
Invalid database ur
I think I miss something, I have not declared which database should be pushed to the Heroku.
Can you help me with this problem ? how can I use heroku db:push, are there any other steps like creating something ? Why I get this error ? Maybe you will say that "have you read documentation or have you searched google?", Yes
EDIT: What I have know is
Local database
Server name Heroku database
Database name application name
username | or windows authentication postgres database
password | username and password
aws address
Should I put/load some file/gem into the Git ?
EDIT 2:
I have test this command but it gives other error.
heroku db:push postgres://localdbUSERNAME:localdbpassword#localdbDATABASENAME/localdbSERVERNAME --app myapp
Error
Failed to connect to database:
Sequel::AdapterNotFound -> LoadError: cannot load such file -- pg
Heroku db:push does not work with SQL Server, it works with MySQL and/or Postgres. You'll need to switch to running one of these database servers, run your migrations/seeds and then use heroku db:push to push your local database to Herokul

Failed to pull db from Heroku

Trying pull the database from Hekoku to local but failed.
heroku db:pull postgres://root:#localhost/db_name
Admittedly, I have no clue how should I construct the url. In the official site it was heroku db:push postgres://postgres:mypass#remotehost/mydb and in this article heroku db:pull postgres://root:#localhost/db_name was used. What the user name and password is for?
Anyway, the error message I got was:
Sequel::DatabaseConnectionError -> TypeError: wrong argument type Sequel::Postgres::Adapter (expected Struct)
Having followed the instructions by update the taps, sequel, and pg and here is my gem list:
rest-client (1.6.7)
sinatra (1.0)
taps(0.3.24)
sequel (3.37.0, 3.20.0)
pg (0.14.0)
This question is no longer relevant now as I have switched from the shared sqlite database to the 9.1 development pg database as been suggested here. Consequently, instead of using the simple db pull/push , I will use a more sophiscated pgbackup ,which was actually recommended by Heroku.

Google App Engine Bulkloader “Authentication Failed”

I'm trying to use the bulkloader to load my data to the App-Engine server. I run the following command using Python 2.5:-
appcfg.py upload_data --application=myappname --kind=mykind
--filename=data_archive.csv --url=http://myappname.appspot.com/remote_api
But its failing with this Authentication error:-
[INFO ] Connecting to myappname.appspot.com/remote_api
[ERROR ] Exception during authentication
URLError: <urlopen error [Errno 10061] No connection could
be made because the target machine actively refused it>
[INFO ] Authentication Failed
My idea is to do a bulk download from my development server and then use this dump to do a upload to the app-engine server. The bulk download worked fine. I used this format for this:-
appcfg.py download_data --application=myappname --kind=mykind
--url=http://localhost:8888/remote_api --filename=data_archive.csv
But the bulk upoad fails. A couple of things: the bulk download asked me for a userid and password, but the bulk upload does not. Also, I don't currently have a app.yaml file which I see mentioned a lot - do I need one to do this ?
Thanks in advance for any help.
M.
EDIT
For anyone else struggling with this, the problem was indeed being behind the proxy server, but there was another 'error' with what is above. The app-id needs the "s~" bit added to it.
appcfg.py upload_data --application=s~myappname --kind=mykind
--filename=data_archive.csv --url=http://myappname.appspot.com/remote_api
This isn't an authentication issue - that message is a red-herring - your machine is unable to contact the App Engine app at all. Do you have a proxy you need to transit through in order to make external connections?
You do not need --application=s~myappname when using bulkloader - Google have mentioned before:
Warning! Do not use the --application= flag to get the application ID
when using the bulk loader. Instead, use --url=.
For more detail take a look here:
https://developers.google.com/appengine/docs/python/tools/uploadingdata
app.yaml is how it finds your server. I am not sure how you can try and upload without one.
In addition to having an app.yaml that points to the production server, the production server also needs to have remote_api turned on (in it's app.yaml and in the version you are trying to reach):
builtins:
- remote_api: on

Resources