How to access Magento bitnami on GCP database and run SQL statement - sql

How to access Magento bitnami on GCP database and run SQL statements. I do not know where and how to connect to the Magento bitnami on GCP database and run SQL statements

Bitnami Engineer here.
You have different options to run those SQL commands:
Access the instance using a SSH connection and connect to MySQL using the command line. You will need to configure the SSH key in the Google Console in case you don't have a valid one. Then, you can access MySQL by running this command
mysql -u root -p bitnami_magento
Create a SSH tunnel to access phpMyAdmin: We configure phpMyAdmin to only be accessible using a local connection. The SSH tunnel will allow you access /phpmyadmin and you could run the SQL commands there.
https://docs.bitnami.com/google/apps/magento/administration/access-phpmyadmin/
If you need more information about how SSH works and how to access the instance, please check our documentation
https://docs.bitnami.com/google/faq/get-started/connect-ssh/

Related

Error 2002 or 2013 when connecting to my MariaDB database on Cloud SQL

I´m experiencing some kind of network issue when connecting to my MariaDB remotely, which is hosted on a CloudSQL instance (nevertheless, I think that this is unrelated).
When I'm trying to connect through mysql.exe or mariadb.exe from my installation of mariaDB:
mysql.exe -h x.y.z.a -u test -p
mariadb.exe -h x.y.z.a -u test -p
I'm getting two different error types:
ERROR 2002 (HY000): Can't connect to server on '34.105.136.61' (10060)
< OR >
ERROR 2013 (HY000): Lost connection to the server at 'handshake: reading initial communication packet', system error: 0
Sometimes is the first one and in other cases the second one.
I understand that both errors can be caused due a network/firewall issue, but I already tried the following:
Adding an exception to the executables on the Windows firewall
Disabling Windows Defender
Adding a firewall rule to allow all the traffic from all ports/source/destination
And I'm still getting the same errors.
Additionally, I also use DataGrip as IDE on the same computer, and from the IDE I'm able to connect correctly to the database, so it doesn´t seem to be caused by the server.
Any idea will be highly appreciated.
EDIT: when I use telnet telnet x.y.z.a 5432 I'm connecting correctly, so the port seems to be accesible
Cloud SQL supports MySQL, Postgres, and SQL Server engines, but not MariaDB.
Additionally, you tested telnet x.y.z.a 5432, but the port for Cloud SQL MySQL instances is 3306. (5432 is the port for Postgres).
You should verify which type of Cloud SQL instance you have created, and that you are using the right cli to connect with it.

Can I SSH to Local Weblogic AdminServer via Command Line?

From Eclipse, when I startup my local Oracle Weblogic Server 12c to run my web application locally, I can visit the Weblogic AdminServer Console at localhost:7001/console. However is there way I can login to the AdminServer via putty with a Command Line interface?
What would my hostname or IP address be for the login, and my port would be 22? Then I would expect to use the same username and password I use to login to the Server console GUI.
The Weblogic admin console does not listen on SSH protocol, the best you can do is log in to the local server where Weblogic is running, and access the scripting tool, via something like the following
wlst.sh
connect('weblogic','password','t3://localhost:7001');
And then run commands that Weblogic understands. The username and password you would have set up during installation. You can also invoke it from the command line via Java, as shown in the following tutorial.
Weblogic Scripting Tool tutorial

How do I grant Azure Cloud Shell access to my Azure SQL Server using least-privilege?

Suppose I create an Azure SQL Database and want to use the Azure Cloud Shell to administer it.
The first port of call would be the 'allow access to Azure services' option. However it is implied that this is rather too liberal as it allows access from any Azure service. I don't want to do that. I only want to grant access to the Cloud Shell.
The documentation describes setting up a server-level firewall rule - setting an IP address range of 0.0.0.0 to 255.255.255.255 would permit any IP to connect to the database. I don't want to do that either - this is clearly not production-ready and even more liberal than allowing access to any service within Azure.
I don't know the IP address of Cloud Shell, it's presumably dynamically allocated.
How do I grant access to just the Cloud Shell?
The PowerShell/CLI commands you execute in Azure Cloud Shell use the same management APIs as the Portal, so if you can manage a database in the portal than you can the exact same in Azure Cloud Shell. Firewall rules apply to data connections (i.e. T-SQL connections for running queries on the DB), not management operations.
If you run your sql command via Cloud Shell an error will be returned that provide the IP address of Cloud Shell to be white listed in your azure SQL Server firewall! See sample commands and error below:
Import-Module SQLServer
Import-Module Az.Accounts -MinimumVersion 2.2.0
Note: the sample assumes that you or your DBA configured the server to accept connections using
that Service Principal and has granted it access to the database (in this example at least
the SELECT permission).
Obtain the Access Token: this will bring up the login dialog
Connect-AzAccount
$access_token = (Get-AzAccessToken -ResourceUrl https://database.windows.net).Token
Now that we have the token, we use it to connect to the database 'mydb' on server 'myserver'
Invoke-Sqlcmd -ServerInstance myserver.database.windows.net -Database mydb -AccessToken $access_token`
-query 'select * from Table1'
--Invoke-Sqlcmd: Cannot open server 'myserver' requested by the login. Client with IP address '20.XXX.XXX.XX' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect.

Connecting to SQL database on localhost server.

I have Apache and SQL running using Xampp and have created a database called "company" in phpMyAdmin. I want to connect to that database using my terminal. I try this, but it fails:
What is with this error? Am I not using the correct syntax?
Don't specify database you want connect to. Try:
mysql -u USERNAME -p
use DBNAME;
https://www.a2hosting.com/kb/developer-corner/mysql/connect-to-mysql-from-the-command-line

Access Hive Tables in SQLClient but not from the Putty

I am new to Hive, MapReduce and Hadoop.
I am using Putty to connect to hive table and access records in the tables. So what I did is- I opened Putty and in the host name I typed- vip.name.com and then I click Open. And then I entered my username and password and then few commands to get to Hive sql. Below is the list what I did
$ bash
bash-3.00$ hive
Hive history file=/tmp/rkost/hive_job_log_rkost_201207010451_1212680168.txt
hive> set mapred.job.queue.name=mdhi-technology;
hive> select * from table LIMIT 1;
So my question is-
Is there any other way I can do the same thing in any Sql client like Sql Developer or Squirel SQL Client instead of doing it from the command prompt. And if it is there then what is the step by step process to do this considering my example as I am logging to vip.name.com from Putty .
And same thing if I need to do through JDBC Program in my windows machine then how I can do it. Means with the JDBC Program, how I can access Hive tables and get the result back. As I know how I can do this with the oracle tables. But the only confusion I have is, as I am using this hostname vip.name.com to log into Putty. I am hoping the question is clear. Any suggestion will be appreciated.
In short my question is- Can I do the same thing in any SQLClient instead of logging from the Putty?
Update-
I tried doing the way Mark has suggested me. But I am always getting- Hive: Could not establish connection to vip.host.com:10000/default: java.net.ConnectionException: Connection timed out: connect
What are you doing with Putty is SSH'ing into a machine with Hive installed and set up. Then you are issuing Hive queries from the Hive command line. That is one way of issuing Hive queries. There are other ways that don't require SSH'ing, one you probably need is connection via JDBC.
Here is an article which describes how to connect to a Hive installation on Amazon's EMR cluster using SQuirreL via JDBC. The article might appear to be Amazon specific but it's not. As long you have Hive server running on one of the nodes of the cluster and no firewall impeding connection between the client machine and one running Hive, you should be able to connect.
A couple things you might want to keep in mind related to the above link:
You can ignore step 3 where it asks you to create a SSH tunnel unless you are using EMR.
The port that you enter in your connection URI might be different in your case. Replace localhost with the fully qualified domain name of the machine that Hive is running on. To find out which port Hive server is listening on, you can look into your Hive server nanny log file present in the log directory (whose location depends on your installation) or run a simple netstat -a command. I believe 10000 is the default port number, so it might make sense to try out 10000 directly.