i have copied the drupal files to the live server using fzilla, now when i open the live site it says site offline,The mysql error was: Unknown MySQL server host 'dbramha' (1).,in settings.php i have given db_url as $db_url = 'mysql://dbramha/testing', testing is the database used locally, do i have to install drupal again in the server?
The error is Drupal saying it can't see the database. Depending on your hosting arrangement for the live server this may or may not be on the same server as the Drupal installation.(It's most likely on another server though)
Have you uploaded the database? - Most commonly done by producing a SQL dump from the local development DB and importing it into the live one.
Just copying the Drupal files is only half of the story.
you have to change the db_url like this
* Database URL format:
* $db_url = 'mysql://username:password#localhost/databasename';
* $db_url = 'mysqli://username:password#localhost/databasename';
* $db_url = 'pgsql://username:password#localhost/databasename';;
you have also to put your mysql in the live DB :)
Related
How i can backup data my database psql on Heroku to my local computer and i want to move to another sever. can heroku backup a database my server to my local computer?
If you app needs some sql database, you should have access to the connection parameters like the url, user and password. There is no chance for you app to connect to a sql database without these parameters
Reviewing the teledrive docs, I found the variable which contains that values:
DATABASE_URL
format: postgresql://[user]:[password]#[host]:[port][/dbname][?paramspec]
Is similar to java and other languages: https://devcenter.heroku.com/articles/connecting-to-relational-databases-on-heroku-with-java#using-the-jdbc_database_url-in-a-spring-boot-app
You can get these values usually in the environment variables configuration in heroku
Something like this:
Your duty is to find these values.
import & export using some IDE
If you have the database connection parameters and the database has public access, you could use any database ide . I recommend you the dbeaver because is free and powerful. You could use it to connect to any database in the galaxy.
Here are the steps to export and restore a database.
https://community.pyramidanalytics.com/t/h7hk07w/how-to-backup-and-restore-a-postgresql-database-via-dbeaver
Basically you should:
connect to your heroku postgress,
export the data
connect to another postgres
import the data
import & export using the shell
This is more fast than an IDE. Check this to understand it: https://simplebackups.com/blog/postgresql-pgdump-and-pgrestore-guide-examples/
We always normally work in Azure where I write around 200 stored procedures a year in their SQL Server database.
We had to create a SQL Server database in AWS-RDS and still call it in our Node APIs like usual. I was able to quickly and easily set up the AWS DB in SQL Server Management Studio so I do know the credentials.
I created several tables and several stored procedures with no problems and tested to make sure they worked there. When I called them like I normally do in Node, I found I was getting an error
Could not find stored procedure
I went through forums all over but most of the data pertains to MySQL instead of SQL Server, and after trying everything I saw in the forums have not been able to complete what should be a very simple process. I would imagine there is some simple thing I missed, but after 2 days it is time for some fresh ideas.
I am setting up the credentials like this:
var awsConnection = {
host : process.env.RDS_HOSTNAME,
user : process.env.RDS_USERNAME,
password : process.env.RDS_PASSWORD,
port : process.env.RDS_PORT
};
I am using the endpoint provided by AWS for the host, the username and password I use to login to SQL Server Management Tool (which works). The port number is the one specified by AWS (1433 - the default for SQL Server).
I call it in my api like this:
await sql.connect(connectionAWS).then(pool => {
// Stored procedure
console.log("awsConnection INSIDE: " + JSON.stringify(awsConnection));
return pool.request()
.input('repId', sql.VARCHAR(40), repObj.RepID)
.execute('UserExistsBD');
}).then(async result => { ...
I added the console.log to see if we were getting past the login and it appears that we do. I also used Telnet to make sure the endpoint/port combo work and they do. I also checked AWS to make sure the Subnets, Route tables, and gateways were good and to make sure my IP Address was white listed. Any ideas would be very much appreciated!
Loading the site returns the error: site map root node is null, the database is demo data stock
You can run this SQL command against the database to check if the node exists:
SELECT * from sitemap where Title = 'Sitemap Root' and CompanyID > 0;
If it is not there the deployment is corrupted and you will need to re-install the website.
There's not enough information in the question to determine how it was deployed and which data set was used. For SalesDemo data it should be deployed from the wizard.
I've mostly worked with PHP/MySQL but I've now been handed a Node.js/MongoDB project on Github.
Having gone through a Mongo tutorial, I feel I understand the concept to a reasonable extent now, but I am still unsure how to do the most basic thing - view the Mongo database associated with the project.
In the config file, I found the following:
module.exports = {
database: {
url: 'localhost:27017/app_name'
},
But seeing how I'm on a remote machine, how do I reach the database? Do I need to ask the previous dev for the DB so I can set it up locally?
Searching the code for the word mongo it only appears in packages.json so that's not a lot of help.
localhost:27017
means the DB is in the local machine in which your are developing your app.
In your case, you have MONGO DB installed in your local machine and run the project.
Otherwise if you have a centralized DB then you have to configure that IP here as follows:
Also configure your mongodb.config of your remote DB to accept the connection from your local machine by changing the "BIND IP"
module.exports = {
database: {
url: 'yourRemoteIP:27017/app_name'
},
Use a GUI tool, i would recommend MongoChef. All you need to do is when you start the server, just open this GUI and connect to DB. GAME ON!! You will be able to see your collections and you are ready to go. You can also run mongo query direct on the shell. It is a helpful tool for playing with your local DB.
PS I am considering you want to see your local DB.
You can access your DB through terminal as well, all upto you.
Im working on a Drupal installation where the setup in my local testing server is different from online server.
On my local server drupal is installed in /var/www/my_drupal and the base_path is set to /mydrupal but on the online server its installed on the root of the site, usually /public_html/
So my problem is I wanted to set a base_path and base_url variable depending on the server i am on. Where do i place my codes so that it's accessible site-wide.?
Thanks!
Luckily Drupal already has taken care of this for you
See the api site for a full listing
Of particular interest to you should be:
$base_path developer/globals.php The base path of the drupal installation. At least will default to /.
$base_url developer/globals.php The base URL of the drupal installation.
I would set it in your settings file in sites/default/settings.php just use an if statement to detect whether it is the local or live site ur on and then set the variables accordingly.
if ($_SERVER['SERVER_NAME'] == 'localhost') {
// the script is running on the local
} else {
// it is on remote
}