database - Setting up laravel project (local) with database hosted in 000webhost - database

I have project on my local computer. I want to test my db online on 000webhost. I set .env file like this
.env
and I had error like this
error
thanks before

If your database is hosted on an external server / hosting service (e.g. 000webhost) then your database DB_HOST in .env won't be "localhost", it would be something like this:
mysql#.000webhost.com
Where the # is number of the allocated database server for your site.
Typically, when you create a new database, they show the database access details, use those details.

Related

Update A PostgreSQL Database to Heroku without AWS

I have a local PostgreSQL Database for my Discord Bot on my PC and want to update to my Heroku Application. I have added the Heroku Postgres Addon, but don't know how to upload the Database. I can't use the Amazon Web Services as told in the devcenter since i don't have any Credit Card. Is there any way to upload the Database without AWS? Thank You and sorry for my bad English
You can dump your local database contents to a SQL file with pgdump. Then you can access your Heroku database from your local machine and upload your SQL using the psql command-line client. Get the access url like this from the Heroku command and put it into your client program.
heroku config | grep HEROKU_POSTGRESQL
Know this: sometimes Heroku migrates your data from one host machine to another. When they do that they change your access url. So retrieve that url again whenever you use the psql client.

postgresql-heroku: unable to create a database

I have created a PostgreSQL database on Heroku. I have downloaded pgAdmin 4 on my macOS machine and I was able to connect pgAdmin to my remote Heroku database server instance I have just created. But now I can't do anything:
The option to create a new database is disabled for me (Object -> Create -> Database)
When I extend the databases node, I can't see the database name created in Heroku. But I see a long list of database names for which I don't have access rights
Finally I can't write any SQL scripts; the SQL editor is read-only.
Basically I can't do nothing apart from starting the pgAdmin application.
I suppose it is a matter of my user privilege. But how can I change my user privilege if the SQL editor is read-only?
You won't be able to create a database on Heroku Postgres with pgAdmin.
When you provision a database on Heroku Postgres you are given a single database, not administrative access to the whole server:
As part of the provisioning process, a DATABASE_URL config var is added to your app’s configuration. This contains the URL your app uses to access the database
You can connect to that existing database with pgAdmin, but you won't be able to create another database. The value of DATABASE_URL is a standard URI that will look something like
postgres://user:password#host:port/database
Feel free to pull individual values out of the DATABASE_URL and use them in pgAdmin.

How to deploy database on linux

I have a small asp.net core website that I push to my server via jenkins. Jenkins does git checkout and then dotnet restore and dotnet run. It works for the website, but I added entity framework and I'm a little confused. How exactly do I move my local database to the server? Or should I create one on the server and then reference it?
I have one mssql database on (localdb)\MSSQLLocalDB, but when I run the server and try to go to a page which gets data from the database I get 500 Internal Server Error.
I would like to have one local db for testing and one on the server, but I just can't wrap my head around all of this.
Well in development, you should write a init script for your database. This will create all the required stuff your application needs.
So in linux...
Install the MySQL, get the users set up, and init the database.
In your application...
Provide the connection string for the DB installed in Linux.
I am not running my app in c# but this is similar to my node app. That is what I do. I develop in windows with Postgres. Then my prod is on a GoDaddy Linux cloud server and I have Postgres installed in that. When I do my git pull for the latest, I don't have to change much because of the .env file for my environment variables.

Moving DotNetNuke From Local To Host

I have installed DotNetNuke 5.6 on my local drive,now i want to move it to host to run web site. What steps should I do to run my web site?
If you haven't done anything to the site on your localhost, it might be easiest to have your host install a clean copy of DotNetNuke to a site for you. Many hosts will do that for you or provide automated tools to install it through their control panel.
In order to help you move a DotNetNuke site, we really need more details in order to provide a complete answer (your hosting company should be able to give you guidance) but the basics are:
1a. If you are just using SQL Express on the local host and plan to
use it under SQL Express on the host as well, you'll just need to
FTP up the DB files along with all the other files.
1b. If you'll be
running the DB under a full SQL Server: Backup your database on your
localhost, copy the DB backup to your host, and restore the database
to the database server provided by the host.
2. Create a blank website on the host.
3. FTP all site files from your localhost to the root directory of your new website.
4. Make sure the Network Service account has Full Access permissions to the root directory and all sub-directories.
5. If you're using a full SQL Server, you'll need to update connection strings in the web.config to point to the restored DB and
ensure you're using a user/login with read/write rights to the DB.
6. Browse to the site.
That should do it.

How can I Upload my ASP.NET website(with database)?

this is my first project ^_^
and I have no previous experience.
I did create the database in my project from within the MVC.
Add New Item > SQL Server Database
then I use ADO.NET Entity DataModel
and I don't need to open my connection each time I deal with the database.. it's only the connection string in the Web.config..
my question is :
how can I upload my database?
is there any resource for such beginner as me :$ ?
I did Google it but I found it very hard for me to know if this is what I want or not, that's why I came here :$
It really depends on what type of access you have to your server.
If you have remote desktop access then run remote desktop (mstsc in run) and connect to your server.
This article shows how to install your web application in IIS on server.
This blog post from Scott Guthrie shows you how to deploy your sql database to your server.
In case you only have access to your server via a control panel (plesk) you should still be able to do the same via a different interface. (you need to go through the instructions given for the specific control panel you are using).
Hope this helps.
For ASP.Net website, just upload all files using FTP, in wwwroot folder of your hosting.
For SQL Server database there are following option.
Attach your MDF file on hosting database server (if you have remote desktop).
Generate a script of whole database with full data, schema, and indexes etc. and run the script in query editor of your hosting panel.
First of all create a database from your hosting panel and a user for your database then Use SQL Serer 2008 (R2 most preferable) and connect with your hosting SQL Server using hosting server name in Server name, your db user id in User Name, and same for password. And then connect, you will find a long list of databases including your own database. Now right click on your database and import data from your local database server to remote database server.

Resources