Sample Header Ad - 728x90

Database Administrators

Q&A for database professionals who wish to improve their database skills

Latest Questions

0 votes
1 answers
716 views
Problem with mysql/data folder is too big and took the whole place
for the first time I am faced with such a problem that has puzzled everyone. I have all hosting busy (AWS lightsail) 78GB and after a few analyzes I realized that 90% of the memory is occupied in the `mysql/data` folder. My wordpress website is weight - 6GB and I removed all binary logs before the p...
for the first time I am faced with such a problem that has puzzled everyone. I have all hosting busy (AWS lightsail) 78GB and after a few analyzes I realized that 90% of the memory is occupied in the mysql/data folder. My wordpress website is weight - 6GB and I removed all binary logs before the problem, so the problem is not connected with that. I can no longer log into *phpmyadmin*, because there is no free space left on the disk. But when I got there until the problem I saw that wp-option has a crazy amount of GB. No plugin was able to clear this and I decided to put it off. Now that everything is busy, most of the commands cannot be executed, especially the mysql commands. I am using SSH. Help if possible.
Edgar Poe (11 rep)
Aug 30, 2020, 07:38 AM • Last activity: Jul 30, 2025, 04:08 AM
0 votes
1 answers
519 views
pgpass entries for multiple SSH tunnels with randomly assigned local ports using the same credentials but different passwords
Let's say I have 4 SSH tunnels to different remote servers, each having different PostgreSQL databases up and running. Each tunnel is mapped to a specific port on my local machine (localhost) as follows: ```ssh ssh -f -N -L 1234:127.0.0.1:5432 userA@serverA ssh -f -N -L 1235:127.0.0.1:5432 userB@ser...
Let's say I have 4 SSH tunnels to different remote servers, each having different PostgreSQL databases up and running. Each tunnel is mapped to a specific port on my local machine (localhost) as follows:
ssh -f -N -L 1234:127.0.0.1:5432 userA@serverA
ssh -f -N -L 1235:127.0.0.1:5432 userB@serverB
ssh -f -N -L 1236:127.0.0.1:5432 userC@serverC
ssh -f -N -L 1237:127.0.0.1:5432 userD@serverD
Now, in my PostgreSQL .pgpass file I can refer for example to my databases with:
# hostname:port:database:username:password
127.0.0.1:1234:database_a:pg_user_a:postgres_password_a
127.0.0.1:1235:database_b:pg_user_b:postgres_password_b
127.0.0.1:1236:database_c:pg_user_c:postgres_password_c
127.0.0.1:1237:database_d:pg_user_d:postgres_password_d
And this is fine. But now, within the pgAdmin4 docker image (https://hub.docker.com/r/dpage/pgadmin4/) the port mapping on the docker 'localhost' cannot be chosen by the user; it's randomly getting assigned a value. Therefore, and because I cannot guess in advance all the ports that will be used for the tunneling, I must change the .pgpass file using wildcards in this way:
127.0.0.1:*:database_a:pg_user_a:postgres_password_a
127.0.0.1:*:database_b:pg_user_b:postgres_password_b
127.0.0.1:*:database_c:pg_user_c:postgres_password_c
127.0.0.1:*:database_d:pg_user_d:postgres_password_d
This is always fine. I guess. (unless I know which IP range is used by pgAdmin4 internally and if I can set up this exact same range in the pgpass file but I don't think this is possible.) Now, what if I'd like to connect to the default postgres maintenance database with the default postgres user on each?
127.0.0.1:*:postgres:postgres:postgres_password_a
127.0.0.1:*:postgres:postgres:postgres_password_b
127.0.0.1:*:postgres:postgres:postgres_password_c
127.0.0.1:*:postgres:postgres:postgres_password_d
How could I let pgAdmin4 knows which password to use with which server as all first four fields are now exactly the same? Setting the same password on all servers, reducing the pgpass file to this single line:
127.0.0.1:*:postgres:postgres:unique_postgres_password
is definitely not an option as I cannot change those {databasenames:usernames:passwords} myself. The local ports being randomly assigned, I guess I'll have to play with the local IP but I'm not successful for the moment as it seems to be automatically set to 127.0.0.1. This latter case is the most extreme one, but one can easily imagine the same issue with two different databases; a pre-production and a production one, having both the same {database:username} but different passwords. Doc: https://www.postgresql.org/docs/14/libpq-pgpass.html
s.k (424 rep)
Feb 16, 2022, 03:54 PM • Last activity: May 31, 2025, 06:06 PM
12 votes
3 answers
76949 views
pgAdmin 4: How to establish a connection through an SSH tunnel/interface in Windows
I installed the latest pgAdmin 4 (v2.1) but I found out that ([related thread][1]), for the moment, the only way to establish a connection through an SSH tunneling is using another outside process, an [example in the pgAdmin's forum][2] says: > I setup a tunnel as follows: > > ssh -f dpage(at)hostna...
I installed the latest pgAdmin 4 (v2.1) but I found out that (related thread ), for the moment, the only way to establish a connection through an SSH tunneling is using another outside process, an example in the pgAdmin's forum says: > I setup a tunnel as follows: > > ssh -f dpage(at)hostname(dot)enterprisedb(dot)com -L 5999: hostname.enterprisedb.com:5432 -N > > (...) I was running on Mac, but the same procedure should work on Linux. On Windows, there's a tunnelling app in Putty iirc, but I don't know how to use it offhand. I have found a simple PuTTY tutorial to establish a connection using an SSH Tunnel . The connection is established but it seems, when I try to connect through pgAdmin it fails or is refused (using _127.0.0.1:3306_ or _127.0.0.1:5432_ as the tunnel's destination). Why?
CPHPython (339 rep)
Mar 6, 2018, 11:29 AM • Last activity: Feb 13, 2025, 12:27 AM
0 votes
1 answers
1063 views
Create LINKED SERVER to MYSQL using SSH
**Is there any way to create a MS SQL Server Linked Server to connect to MySQL through SSH?** I managed to connect to MySQL through SSH using other database management tools like HeidiSQL or DBeaver, however I'd like to have this setup up for SSMS. I downloaded the MySQL ODBC driver but I can't find...
**Is there any way to create a MS SQL Server Linked Server to connect to MySQL through SSH?** I managed to connect to MySQL through SSH using other database management tools like HeidiSQL or DBeaver, however I'd like to have this setup up for SSMS. I downloaded the MySQL ODBC driver but I can't find where to setup the SSH connection enter image description here
user110366 (41 rep)
Feb 8, 2021, 03:10 PM • Last activity: Dec 30, 2024, 02:02 PM
0 votes
1 answers
47 views
mariadb remote access issues
Hello all my name is 0xNosaj I have a website I was given to control and move. It runs on PHP. I have only SSH access to it but I cannot seem to make the phpmyadmin site come up. How I've tried connecting are `ssh -L 8080:1.2.3.4:80 user@1.2.3.4` and `ssh -NL 3307:localhost:3306 root@REMOTE_HOST` Bu...
Hello all my name is 0xNosaj I have a website I was given to control and move. It runs on PHP. I have only SSH access to it but I cannot seem to make the phpmyadmin site come up. How I've tried connecting are ssh -L 8080:1.2.3.4:80 user@1.2.3.4 and ssh -NL 3307:localhost:3306 root@REMOTE_HOST But when I try to connect with credentials I have I get an error when I open the phpmyadmin website on my laptop. >mysqli::real_connect(): (HY000/1045): Access denied for user 'nosaj'@'localhost' (using password: YES) I have done a GRANT ALL on [database] identified by 'PASS'; FLUSH PRIVILEGES; and restarted MariaDB. I do not have the root password for the MariaDB database but I do have root on the Linux server (Ubuntu 18. If this is the wrong forum, if someone could kindly guide me to the correct place I'd sure appreciate it.
nosaj seveer (1 rep)
Nov 23, 2024, 03:05 AM • Last activity: Dec 16, 2024, 03:01 PM
1 votes
0 answers
214 views
executing mariadb-dump with password over ssh
I need to make backups of the remote machine mariadb database. My plan is to run ssh user@remoteip 'mariadb-dump -uuser -ppass --all-databases' > backup.sql from my local machine. I found that remote machines `history` is not being populated with the mariadb-dump command I just executed. `journalctl...
I need to make backups of the remote machine mariadb database. My plan is to run ssh user@remoteip 'mariadb-dump -uuser -ppass --all-databases' > backup.sql from my local machine. I found that remote machines history is not being populated with the mariadb-dump command I just executed. journalctl also did not contain the command. Is there any security reason on the remote side I should be worried about when passing mariadb password in the ssh command? Are there better alternatives?
sanjihan (285 rep)
Sep 13, 2024, 10:27 PM • Last activity: Sep 15, 2024, 05:54 AM
0 votes
1 answers
84 views
Using mysqldump on remote server in rsnapshot returns code 127 while the very same command used locally works fine
As said in the title, I want to backup my remote mysql database with rsnapshot, using mysqldump. I don't have any syntax error, but get a "WARNING 'command" returned 127", and the sql file is not written. Here is what I tried: backup_exec LeBear:"/usr/bin/mysqldump -A lebearcnc > /var/mysql-dumps/my...
As said in the title, I want to backup my remote mysql database with rsnapshot, using mysqldump. I don't have any syntax error, but get a "WARNING 'command" returned 127", and the sql file is not written. Here is what I tried: backup_exec LeBear:"/usr/bin/mysqldump -A lebearcnc > /var/mysql-dumps/mysql.sql" and backup_exec LeBear:"/root/mysql-script.sh" I also tried with --single-transaction and the database name instead of -A, but all different syntax attempts trigger the same warning/error. "LeBear" being the host name in my /root/.ssh/config file, where the username is root. Connection is without password, as I have ssh keys. When I pass either of these commands on the remote host command line "LeBear", they works just fine, meaning the sql file is properly written. Mabe I should add that I don't have any ssh problem using the config file. I would expect to get mysqldump to create the backup and write the sql file as it does when i send the same command locally. Any idea how to solve this ? Thanks for your help. Bernard
Bernard Grosperrin (11 rep)
Jul 12, 2024, 08:50 PM • Last activity: Jul 13, 2024, 01:50 PM
0 votes
0 answers
42 views
MySQL transport protocol integrity check
I am interested whether low level transport protocol of MySQL has some checksums or other integrity check? If I use SSH tunnel with interruptions, is it safe that commands will be received intact and MySQL server will ignore broken data (return error)? I guess SSH encryption will help to protect fro...
I am interested whether low level transport protocol of MySQL has some checksums or other integrity check? If I use SSH tunnel with interruptions, is it safe that commands will be received intact and MySQL server will ignore broken data (return error)? I guess SSH encryption will help to protect from random concatenation of partial commands (e.g. DELETE FROM with arguments from next commands and lost data in between).
i486 (255 rep)
Jan 9, 2024, 02:49 PM • Last activity: Jan 9, 2024, 03:31 PM
0 votes
1 answers
683 views
Connecting to AWS RDS succeeds via terminal but fails in pgAdmin 4. Why?
I can establish an SSH tunnel using `ssh -L 2222: :5432 ec2-user@ -i ~/.ssh/key.pem` and then connect to my RDS using `psql "host=localhost port=2222 user=postgres password= ` These same settings in pgAdmin 4 do not seem to work. - Host name in connection tab = ` ` - Tunnel host = ` ` - Port in conn...
I can establish an SSH tunnel using ssh -L 2222::5432 ec2-user@ -i ~/.ssh/key.pem and then connect to my RDS using psql "host=localhost port=2222 user=postgres password= These same settings in pgAdmin 4 do not seem to work. - Host name in connection tab = `` - Tunnel host = `` - Port in connection tab = 5432 - Port in SSH tunnel tab = 2222 - Username in connection tab = postgres - Username in ssh tunnel tab = ec2-user - Password in connection tab = `` - And identity file in ssh tunnel tab = ~/.ssh/key.pem After trying for a while pgAdmin 4 fails with: unable to connect to server: Failed to create the SSH Tunnel. Error: Could not establish session to SSH gateway cat ~/.pgadmin/pgadmin4.log Just gives me:
ERROR	pgadmin:	Could not establish session to SSH gateway
Traceback (most recent call last):
  File "/usr/pgadmin4/web/pgadmin/utils/driver/psycopg3/server_manager.py", line 610, in create_ssh_tunnel
    self.tunnel_object.start()
  File "/usr/pgadmin4/venv/lib/python3.10/site-packages/sshtunnel.py", line 1331, in start
    self._raise(BaseSSHTunnelForwarderError,
  File "/usr/pgadmin4/venv/lib/python3.10/site-packages/sshtunnel.py", line 1174, in _raise
    raise exception(reason)
sshtunnel.BaseSSHTunnelForwarderError: Could not establish session to SSH gateway
I'm really lost on how to proceed given *it works* via the terminal. So clearly not some security group issue on AWS's side. I've tried deleting ~/.pgadmin and trying again, but same result. Any help appreciated thanx. In case this helps:
lsb_release -a
No LSB modules are available.
Distributor ID:	Pop
Description:	Pop!_OS 22.04 LTS
Release:	22.04
Codename:	jammy
Frikster (103 rep)
Sep 2, 2023, 04:38 AM • Last activity: Sep 2, 2023, 10:39 AM
1 votes
1 answers
2233 views
Unable to downgrade MySQL from version 8 to 5.6 nor start MySQL (MySQL Error Log Included)
I run a Plesk VPS (**OS:** Centos 6/Linux (Final)), whereby I recently tried to upgrade the MySQL from version 5.5.55 to version 5.6. Being relatively new to this area, I strictly followed this [Plesk Article][1] Specifically following the steps within the 'Plesk on CentOS 6' Tab. Unfortunately, I m...
I run a Plesk VPS (**OS:** Centos 6/Linux (Final)), whereby I recently tried to upgrade the MySQL from version 5.5.55 to version 5.6. Being relatively new to this area, I strictly followed this Plesk Article Specifically following the steps within the 'Plesk on CentOS 6' Tab. Unfortunately, I made the mistake of assuming version 8 was disabled as default. As a result, MySQL version 8 was installed and is now causing me major issues. To the point, where I cannot start MySQL. I have tried to downgrade, from version 8 to version 5.6, by opening the file /etc/yum.repos.d/mysql-community.repo Notepad++, where I ensured the below was entered: # Enable to use MySQL 5.5 [mysql55-community] name=MySQL 5.5 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/6/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql # Enable to use MySQL 5.6 [mysql56-community] name=MySQL 5.6 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql # Enable to use MySQL 5.7 [mysql57-community] name=MySQL 5.7 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql80-community] name=MySQL 8.0 Community Server baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/6/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-connectors-community] name=MySQL Connectors Community baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/6/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-tools-community] name=MySQL Tools Community baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/6/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-tools-preview] name=MySQL Tools Preview baseurl=http://repo.mysql.com/yum/mysql-tools-preview/el/6/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-cluster-7.5-community] name=MySQL Cluster 7.5 Community baseurl=http://repo.mysql.com/yum/mysql-cluster-7.5-community/el/6/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-cluster-7.6-community] name=MySQL Cluster 7.6 Community baseurl=http://repo.mysql.com/yum/mysql-cluster-7.6-community/el/6/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql Upon entering the command yum update mysql, the following appeared on the screen: Loaded plugins: fastestmirror, security Setting up Update Process Loading mirror speeds from cached hostfile * atomic: www4.atomicorp.com * epel: mirror.freethought-internet.co.uk * remi-safe: mirror.netweaver.uk Package(s) mysql available, but not installed. No Packages marked for Update I then continued with the steps, in the hope that the installation would still miraculously work somehow. I got as far as service mysqld start where I generated the same error as before, which was: MySQL Daemon failed to start. Starting mysqld: [FAILED] I am not just absolutely stumped as to how to downgrade to MySQL version 5.6 and to start back up MySQL. **MySQL Log:** [Warning] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release. [System] [Server] /usr/sbin/mysqld (mysqld 8.0.16) starting as process 14057 [System] [Server] Starting upgrade of data directory. [ERROR] [InnoDB] Unsupported redo log format (0). The redo log was created before MySQL 5.7.9 [ERROR] [InnoDB] Plugin initialization aborted with error Generic error. [ERROR] [Server] Failed to initialize DD Storage Engine. [ERROR] [Server] Data Dictionary initialization failed. [ERROR] [Server] Aborting [System] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.16) MySQL Community Server - GPL. **Additional Information:** I am not sure if the below helps but after entering the command yum repolist all | grep mysql, the following information appeared: mysql-cluster-7.5-community MySQL Cluster 7.5 Community disabled mysql-cluster-7.6-community MySQL Cluster 7.6 Community disabled mysql-connectors-community MySQL Connectors Community enabled: 94 mysql-tools-community MySQL Tools Community enabled: 78 mysql-tools-preview MySQL Tools Preview disabled mysql55-community MySQL 5.5 Community Server disabled mysql56-community MySQL 5.6 Community Server enabled: 512 mysql57-community MySQL 5.7 Community Server disabled mysql80-community MySQL 8.0 Community Server disabled **Version 8 References** As per the advise in the Comment section, I have performed the command yum list mysql* as to generate the following results as to identify any relevant 'version 8 packages' to be removed. The only problem is, I am not sure which are 'version 8 packages': Loaded plugins: fastestmirror, security Determining fastest mirrors epel/metalink | 30 kB 00:00 * atomic: www4.atomicorp.com * epel: mirror.freethought-internet.co.uk * remi-safe: mirror.netweaver.uk PLESK_17_8_11-extras | 2.9 kB 00:00 PLESK_17_8_11-extras/primary_db | 32 kB 00:00 PLESK_17_PHP56 | 2.9 kB 00:00 PLESK_17_PHP56/primary_db | 14 kB 00:00 PLESK_17_PHP70 | 2.9 kB 00:00 PLESK_17_PHP70/primary_db | 15 kB 00:00 PLESK_17_PHP73 | 2.9 kB 00:00 PLESK_17_PHP73/primary_db | 17 kB 00:00 atomic | 3.4 kB 00:00 atomic/primary_db | 651 kB 00:00 epel | 5.3 kB 00:00 epel/primary_db | 6.1 MB 00:00 mysql-connectors-community | 2.5 kB 00:00 mysql-connectors-community/primary_db | 37 kB 00:00 mysql-tools-community | 2.5 kB 00:00 mysql-tools-community/primary_db | 50 kB 00:00 mysql56-community | 2.5 kB 00:00 mysql56-community/primary_db | 261 kB 00:00 plesk-migrator | 2.9 kB 00:00 plesk-migrator/primary_db | 6.7 kB 00:00 plesk-migrator-tp | 2.9 kB 00:00 plesk-migrator-tp/primary_db | 1.2 kB 00:00 remi-safe | 3.0 kB 00:00 remi-safe/primary_db | 1.2 MB 00:00 Available Packages mysql.i686 5.5.44-30.el6.art atomic mysql.x86_64 5.5.55-1659.el6.art atomic
Craig (119 rep)
Jun 13, 2019, 11:27 PM • Last activity: Mar 13, 2023, 05:03 AM
-1 votes
1 answers
905 views
Copy between database using pg_dump and SSH
I want to copy a tabel from one server to another using pg_dump and SSH. Here is the script that I run from the source database : pg_dump -h 127.0.0.1 -Fc --dbname=postgresql://postgres:passwd@127.0.0.1:5432/db_reference --table db_reference.education | ssh -C username@10.100.8.43 "psql -h 10.100.8....
I want to copy a tabel from one server to another using pg_dump and SSH. Here is the script that I run from the source database : pg_dump -h 127.0.0.1 -Fc --dbname=postgresql://postgres:passwd@127.0.0.1:5432/db_reference --table db_reference.education | ssh -C username@10.100.8.43 "psql -h 10.100.8.43 -U postgres -p 5432 x_db_test" There is error: host key verification failed Questions : 1. Is the command correct? 2. How to remove the error? Thanks
padjee (337 rep)
Nov 22, 2022, 08:56 AM • Last activity: Jan 29, 2023, 09:53 PM
0 votes
1 answers
853 views
sqlplus: command not found Using SSH on Windows to VMware linux
I have oracle Database 12c in a virtual machine with the database working normally in a linux environment (Centos). Through windows, using ssh I was able to connect to the linux virtual machine. But when I try to connect the database using 'sqlplus' command, I get the following error. bash: sqlplus:...
I have oracle Database 12c in a virtual machine with the database working normally in a linux environment (Centos). Through windows, using ssh I was able to connect to the linux virtual machine. But when I try to connect the database using 'sqlplus' command, I get the following error. bash: sqlplus: command not found... output after run comand 'sqlplus'
Tomas A (3 rep)
Jan 24, 2023, 08:53 AM • Last activity: Jan 24, 2023, 03:12 PM
0 votes
0 answers
444 views
MySQL losing connection after few minutes while waiting
I have an annoying problem. I think the connection is lost when there is no operation in **mysql** for a while. I've added a video to make it more explanatory. I tried the solutions on the internet but none of them worked. Please help me find the error, how can I log/ fix it? [video for mysql][1] (L...
I have an annoying problem. I think the connection is lost when there is no operation in **mysql** for a while. I've added a video to make it more explanatory. I tried the solutions on the internet but none of them worked. Please help me find the error, how can I log/ fix it? video for mysql (Lost connection to MySql server during query) **MySql variables:** (SHOW global VARIABLES LIKE '%timeout%';): +-----------------------------------+----------+ | Variable_name | Value | +-----------------------------------+----------+ | connect_timeout | 10000 | | delayed_insert_timeout | 300 | | have_statement_timeout | YES | | innodb_flush_log_at_timeout | 1 | | innodb_lock_wait_timeout | 50 | | innodb_rollback_on_timeout | OFF | | interactive_timeout | 60000 | | lock_wait_timeout | 31536000 | | mysqlx_connect_timeout | 30 | | mysqlx_idle_worker_thread_timeout | 60 | | mysqlx_interactive_timeout | 28800 | | mysqlx_port_open_timeout | 0 | | mysqlx_read_timeout | 30 | | mysqlx_wait_timeout | 28800 | | mysqlx_write_timeout | 60 | | net_read_timeout | 60000 | | net_write_timeout | 60000 | | replica_net_timeout | 60 | | rpl_stop_replica_timeout | 31536000 | | rpl_stop_slave_timeout | 31536000 | | slave_net_timeout | 60 | | ssl_session_cache_timeout | 300 | | wait_timeout | 60000 | +-----------------------------------+----------+ **My /etc/ssh/sshd_config file:** # This is the sshd server system-wide configuration file. See # sshd_config(5) for more information. # This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr /bin:/sbin:/bin:/usr/games # The strategy used for options in the default sshd_config shipped with # OpenSSH is to specify options with their default value where # possible, but leave them commented. Uncommented options override the # default value. Include /etc/ssh/sshd_config.d/*.conf #Port 22 #AddressFamily any #ListenAddress 0.0.0.0 #ListenAddress :: #HostKey /etc/ssh/ssh_host_rsa_key #HostKey /etc/ssh/ssh_host_ecdsa_key #HostKey /etc/ssh/ssh_host_ed25519_key # Ciphers and keying #RekeyLimit default none # Logging #SyslogFacility AUTH #LogLevel INFO # Authentication: #LoginGraceTime 2m PermitRootLogin yes #StrictModes yes #MaxAuthTries 6 #MaxSessions 10 #PubkeyAuthentication yes # Expect .ssh/authorized_keys2 to be disregarded by default in future. #AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2 #AuthorizedPrincipalsFile none #AuthorizedKeysCommand none #AuthorizedKeysCommandUser nobody # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts #HostbasedAuthentication no # Change to yes if you don't trust ~/.ssh/known_hosts for # HostbasedAuthentication #IgnoreUserKnownHosts no # Don't read the user's ~/.rhosts and ~/.shosts files #IgnoreRhosts yes # To disable tunneled clear text passwords, change to no here! PasswordAuthentication no #PermitEmptyPasswords no # Change to yes to enable challenge-response passwords (beware issues with # some PAM modules and threads) KbdInteractiveAuthentication no # Kerberos options #KerberosAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes #KerberosGetAFSToken no # GSSAPI options #GSSAPIAuthentication no #GSSAPICleanupCredentials yes #GSSAPIStrictAcceptorCheck yes #GSSAPIKeyExchange no # Set this to 'yes' to enable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will # be allowed through the KbdInteractiveAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via KbdInteractiveAuthentication may bypass # the setting of "PermitRootLogin yes # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and KbdInteractiveAuthentication to 'no'. UsePAM yes #AllowAgentForwarding yes #AllowTcpForwarding yes #GatewayPorts no X11Forwarding yes #X11DisplayOffset 10 #X11UseLocalhost yes #PermitTTY yes PrintMotd no #PrintLastLog yes TCPKeepAlive yes #PermitUserEnvironment no #Compression delayed ClientAliveInterval 15 ClientAliveCountMax 3 #UseDNS no #PidFile /run/sshd.pid #MaxStartups 10:30:100 #PermitTunnel no #ChrootDirectory none #VersionAddendum none # no default banner path #Banner none # Allow client to pass locale environment variables AcceptEnv LANG LC_* # override default of no subsystems Subsystem sftp /usr/lib/openssh/sftp-server # Example of overriding settings on a per-user basis #Match User anoncvs # X11Forwarding no # AllowTcpForwarding no # PermitTTY no # ForceCommand cvs server
Dream59 (1 rep)
Nov 3, 2022, 07:58 PM • Last activity: Nov 7, 2022, 03:38 PM
1 votes
1 answers
347 views
How to transfer postgres databases from one server to other
VPS server has old Debian 6 Squeeze with Postgres 9.1 It has 24 databases. Every night backup copies are created using pg_dump to /root/backups directory for every database. This directory has 24 .backup files with total size 37 GB. I installed new VPS server with Debian 10 and Postgres 12. How to t...
VPS server has old Debian 6 Squeeze with Postgres 9.1 It has 24 databases. Every night backup copies are created using pg_dump to /root/backups directory for every database. This directory has 24 .backup files with total size 37 GB. I installed new VPS server with Debian 10 and Postgres 12. How to transfer those databases to new server ? Both server have ssh and root user, postgres port 5432 open, 100 MB internet connection and fixed IP addresses. In night they are not used by users, can stopped during move. Should I download .backup files and use pg_restore or use pipe to restore whole cluster.
Andrus (123 rep)
Jan 26, 2020, 04:57 PM • Last activity: Jun 3, 2022, 11:02 AM
0 votes
1 answers
3200 views
Communications link failure SSH Tunnel on Datagrip
I need to connect RDS through SSH for now(Local -> EC2 -> RDS). So I tried to connect MySQL via SSH Tunnel option on Datagrip, however, It cannot connect to server. ``` [08S01] Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not rece...
I need to connect RDS through SSH for now(Local -> EC2 -> RDS). So I tried to connect MySQL via SSH Tunnel option on Datagrip, however, It cannot connect to server.
[08S01] Communications link failure  The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. No appropriate protocol (protocol is disabled or cipher suites are inappropriate).
I tried MySQL Workbench with Standard TCP/IP over SSH option. It works well. Is that different between TCP/IP over SSH and SSH Tunnel? Or Did I something wrong? MySQL Workbench This is my workbench screenshot. It works. Datagrip2 Datagrip3 Datagrip1 This is my Datagrip screenshot. I wrote host as RDS endpoint but it failed.
Minkyu Kim (127 rep)
Mar 4, 2022, 12:31 AM • Last activity: Mar 10, 2022, 10:52 AM
1 votes
1 answers
650 views
How to backup clickhouse over SSH?
In postgreSQL, I usually run this command to backup and compress (since my country have really low bandwidth) from server to local: ``` mkdir -p tmp/backup ssh sshuser@dbserver -p 22 "cd /tmp; pg_dump -U dbuser -Fc -C dbname | xz - -c" \ | pv -r -b > tmp/backup/db_backup_`date +%Y-%m-%d_%H%M%S`.sql....
In postgreSQL, I usually run this command to backup and compress (since my country have really low bandwidth) from server to local:
mkdir -p tmp/backup
ssh sshuser@dbserver -p 22 "cd /tmp; pg_dump -U dbuser -Fc -C dbname | xz - -c" \
 | pv -r -b > tmp/backup/db_backup_date +%Y-%m-%d_%H%M%S.sql.xz
and to restore:
fname=ls -w 1 tmp/backup/*sql.xz | tail -n 1
echo $fname

echo "select 'drop table \"' || tablename || '\" cascade;' from pg_tables WHERE schemaname = 'public';" |
psql -U dbuser |
 tail -n +3 |
 head -n 2 |
 psql -U dbuser

# sudo -u postgres dropdb dbname
# sudo -u postgres createdb --owner dbuser dbname
xzcat $fname | pg_restore  --clean --if-exists --no-acl --no-owner -U dbuser -d dbname
How to do similar thing in Clickhouse (backup, compress on the fly, compress to a file)?
Kokizzu (1403 rep)
Jul 29, 2021, 11:48 AM • Last activity: Aug 30, 2021, 01:58 PM
0 votes
2 answers
492 views
Connecting to local database on Azure VM
Using DBforge to try and connect to a local MSSQL database on an Azure Ubuntu 18 VM, I am getting this error: ``` A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is corr...
Using DBforge to try and connect to a local MSSQL database on an Azure Ubuntu 18 VM, I am getting this error:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify
that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open
a connection to SQL Server)
I have: 1. Enabled SSH on the inbound rules. 2. I can SSH into the Azure VM using PuTTY 3. I have tried both the host name (xx.eastus.cloudapp.azure.com) and the public IP address (13.82.xx.xx) to try and connect, both give this error. 4. I can connect to the website running on the VM by using the host name, and going to the public IP address shows the Apache landing page. 5. The website is running 100%, and I can log in, so the database instance is running. 6. I followed the advice here , and I confirm my server is listening on port 1433. (Log entry: Server is listening on [ 'any' 1433].) 7. Port 1433 is not blocked by a firewall. I have disabled the Azure firewall for testing purposes. 8. Various other answers suggest I must go into services.msc etc., but this is a Linux VM, so those won't work either. I am getting the same error using SSMS, and none of the answers here seem to work for my specific case. All of them speak about connecting to an Azure SQL database, which this is not. Any idea what else I can try?
Kobus Myburgh (135 rep)
Sep 21, 2019, 02:51 PM • Last activity: Jul 6, 2021, 08:00 PM
0 votes
1 answers
307 views
How to restore MySQL DB via command line while closing the SSH session?
I am importing a large MySQL 8 database on Ubuntu 20.04 where the import takes > 24h. Unfortunatelly my provider reconnets every 24h which leads to a stop of the import. I am issuing this command on a ssh shell which blocks the cursor until finished: mysql -u user -p dbname import.txt 2>&1 The comma...
I am importing a large MySQL 8 database on Ubuntu 20.04 where the import takes > 24h. Unfortunatelly my provider reconnets every 24h which leads to a stop of the import. I am issuing this command on a ssh shell which blocks the cursor until finished: mysql -u user -p dbname import.txt 2>&1 The command should also save all output/errors to the txt file import.txt How can this be changed so that it results in a process number and I can close the session?
merlin (323 rep)
Jul 5, 2021, 08:02 AM • Last activity: Jul 5, 2021, 11:07 PM
2 votes
1 answers
620 views
how to 'flush hosts' via ssh
I have a MySQL db hosted on a commercial server as a shared account. Recently I have been getting an error: 'DBI connect('xxxxxx',...) failed: Host 'xxx.xxx.xxx.xxx' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'. However I can ssh into my host but trying to exec...
I have a MySQL db hosted on a commercial server as a shared account. Recently I have been getting an error: 'DBI connect('xxxxxx',...) failed: Host 'xxx.xxx.xxx.xxx' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'. However I can ssh into my host but trying to execute "mysqladmin flush-hosts' tells me 'DBI connect('xxx:example.com','xxxuserxxx',...) failed: Host 'xxx.xxx.xxx.xxx' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'". My host cannot help me (outside their scope) but I am hoping there is a way either to escalate my privileges, or execute a mysqladmin command. Anyone?
Amer Neely (21 rep)
Apr 25, 2018, 01:54 PM • Last activity: Jun 30, 2021, 08:01 PM
2 votes
1 answers
2520 views
Can't Connect to MySQL database through PuTTY
I have a database that runs on pythonanywhere.com, and am trying to connect Tableau to it, and need to set up an SSH Tunnel in order to do so. The [directions][1] on pythonanywhere's website mention PuTTY, and many people on Tableau forums also use it, so this is what I'm going with. I've been tryin...
I have a database that runs on pythonanywhere.com, and am trying to connect Tableau to it, and need to set up an SSH Tunnel in order to do so. The directions on pythonanywhere's website mention PuTTY, and many people on Tableau forums also use it, so this is what I'm going with. I've been trying for about 2 weeks to get this working, but no luck. So here's what happens: 1). I enter ssh.pythonanywhere.com as the host connection on the main page: enter image description here 2). I then go to SSH --> Tunnels, and enter the following information: enter image description here The information in the Destination field has the form my-username.mysql.pythonanywhere-services.com:3306 Then I hit Open, and am prompted for my sign in credentials to Python Anywhere: enter image description here Then I go to Tableau and enter the following information: enter image description here In the password field I type in my database password. The message that always comes up is: [MySQL][ODBC 8.0(w) Driver]Access denied for user 'myusername'@'localhost' (using password: YES) Invalid username or password. Now obviously, there's a natural response to this: double check my password. For now just take my word for it that I've double checked this several times and it is correct. I've tried to find help on PythonAnywhere's forums , and Tableau's forums , but no solutions have been found. Also: I've tried switching out the port 127.0.0.1 with localhost, but this did not work. I **have** connected to my database externally in a Jupyter Notebook using this same information, so I have some confirmation that this info has been used successfully. I've tried connecting to MySQL Workbench using the same info and I get the same error message, which makes me think there's something about my database configuration which is not working, but I have no idea where to look. **UPDATE:** In my PuTTY Bash terminal the command telnet 127.0.0.1 3306 returns the message: Trying 127.0.0.1... telnet: Unable to connect to remote host: Connection refused In my DOS terminal I get the following: enter image description here In my git BASH terminal I type in netstat -an|grep 3306 and get: enter image description here **UPDATE 2:** I was on codementor trying to get this resolved, and we had the following issue: after signing in throuhg PuTTY, I entered the following command: mysql -h 127.0.0.1 -u jonathanbechtel -p Which returned the following error message: ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111) We also tried switching out 127.0.0.1 with localhost and got a different error message: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) To be honest I don't understand the significance of this, but was told by him that this is unusual and might signal some security settings on my account with PythonAnywhere. I started this forum message on their forums to try and troubleshoot it.
Jonathan Bechtel (29 rep)
Nov 6, 2019, 06:05 PM • Last activity: May 13, 2021, 02:03 PM
Showing page 1 of 20 total questions