This was my previous question:
Can someone give me simple example in C, of using pipe() system call to and use ssh to connect to a remote server and execute a simple ls command and parse the reply. Thanks in advance, [...]
I got an answer for that, but I need something more.
I would like to ask how to use a pipe and connect to a remote server using ssh, then open mysql and execute a simple query like SELECT * FROM tables;.
Thanks in advance!
Are you doing this for a challenge?, if yes that's cool because you are doing a hard thing to the end, if not derobert suggestion is the best solution in case you want to communicate with the MySQL server.
Related
I am trying to create a Python job on DataFlow that need a Cloud SQL connection (and I'm a total beginner). I need to execute several MySQL queries in ParDo (Apache Beam). I am using PyMySQL and have problem authenticating, so I tried this answer and apparently it works:
class MyDoFn(beam.DoFn):
def setup(self):
os.system("wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 -O cloud_sql_proxy")
os.system("chmod +x cloud_sql_proxy")
os.system(f"./cloud_sql_proxy -instances={self.sql_args['cloud_sql_connection_name']}=tcp:3306 &")
The thing is, I find this to be more of a work-around. Is it safe to authenticate this way? I would appreciate any help! Thank you in advance.
Yes, this is a safe way to use a Cloud SQL connection. The cloud_sql_proxy uses authentication info from the Compute Engine instance to properly authenticate the connection. See https://cloud.google.com/sql/docs/mysql/sql-proxy#authentication-options for more about this.
Currently I have been working with MySQL on Mac OSX. I have MySql Workbench and MySql installed, along with commands on Terminal, but every time I try to open a database it comes up with this:
Could someone explain what I have done wrong? I have tried everything (commands, reinstalling MySQL...)
There is a mistake in ip address . make sure you use correct format. if you use it locally give "127.0.0.1:3306" or "localhost:3306"
"8.0.13:3306" is not a legal "ip:port" format, make sure you've entered a correct IP address such as "10.8.0.13:3306"
First of all I should mention maybe this question already posted but I couldn't find a solution. Let me explain it to you.
I want to compare two databases on my server using DB compare. I need server name.
I added host name as server name. reference here but it doesn't work.
I added my IP address in Remote MySQL too but it's still same. I mean I got error
It's failed to connect to server
**
Please guide me how to find Server Name is Cpanel Share server ?
**
Thank you
You should read the product description
"DBComparer is a professional database comparison tool for analyzing the differences in Microsoft SQL Server 2008 (and 2005) database structures."
it is not compatible with mysql
Best method to get Hostname of domain is to use rDNS lookup.
it's very simple, open below website and put your domain
Check here: http://www.intodns.com/
and then find keyword Your reverse (PTR) record and your will see your hostname of reverse IP.
Example for facebook.com: 18.159.220.66.in-addr.arpa -> msgin-shv-08-frc3.facebook.com
or you can get by terminal command by #host xx.xx.xx.xx xx will be your server IP
It will show like this:
root#server [~]# host 66.220.158.68
68.158.220.66.in-addr.arpa domain name pointer edge-star-mini-shv-07-frc3.facebook.com.
I tried to cleanup my expired django sessions using ./manage.py cleanup and after hitting enter it seems to be doing something for a few seconds and then all it returns is 'killed'.
I also tried running the mysql shell and navigate to that table and do 'select * from django_sessions;' and I get kicked from the shell and back to bash with the same message: 'killed'.
What is wrong here? How can I debug that?
It seems like something kills long running commands. This is usual sitation on shared hosting. If you are not the owner/administrator of this server, the answer should be given by the actual owner/administrator.
Maybe these answers will help you: Who "Killed" my process and why?
Actually I'm having more than one problem...but all of it has to do with connecting or working with the MySQL database...First you can see one of the errors on my website and no matter what you choose it seems to just say it can't connect to the database...I've configured a configure.php file to allow files to connect to the MySQL database...see the website here:
http://netsurfer123.byethost11.com/index.php
Then when I try to log-in to the Admin area of my MySQL database it just says:
phpMyAdmin - Error
Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.
Please let me know what I can do to correct these errors...and thanks very much in advanced for any helpful response/s.
First you need to check if the MySQL server is actually running. Use a command such as
/etc/rc.d/init.d/mysqld status
Or similar for your system if possible.
Did you check the web server log file? Does it contain errors as indicated by phpMyAdmin?
Your site is simply unable to connect to the database to which it's trying to connect. This could be for any number of potential reasons:
Is the database running?
Is the database accessible by that machine? (Maybe there's a firewall in between the two servers, if they're separated?)
If the database is on that same machine, are you connecting to it properly? (Maybe it allows only certain connection methods, such as a socket vs. the loopback address?)
Is your connection string correct? Maybe the login is failing?
Check your PHP logs, your Apache logs, your MySQL logs. One of them is complaining about something and it's probably trying to tell you what.