- i lost the connection with my vps server [closed]
- 2 Answers 2
- MySQL 5.5 — Lost connection to MySQL server during query
- SCP Lost Connection [closed]
- How to Fix MySQL Lost Connection
- What Causes “Lost Connection to MySQL Server During Query” Error?
- MySQL Show Timeout Value
- Fix MySQL Lost Connection Error by Updating the Timeout Variables
- Conclusion
- About the author
- John Otieno
i lost the connection with my vps server [closed]
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
i am using vps running by ubuntu. i lost the connection with my vps server by making a fatal error by changing the network interfaces setting located in /etc/network/interfaces i set static networking instead of dhcp and set the eth0 ip and netmask but i forget to add the getway, so the connection is lost and i can’t connect to the server any more. Thanks in advance..
Call your ISP. There is really nothing we can do to help you if you have broken networking on your server.
2 Answers 2
Did you change the configuration files, or just change the current config? If the latter than you could just reboot the VPS using what-ever interface your provider gives for such things.
If you are hosting with someone like linode which allows you to create more than one server within your account then you could try create a simple rescue server (linode have a small image especially for this), connect this to the virtual disk(s) of the disconnected VM and fix the configuration from there.
Failing the above, you will just have to contact your host for support, and ask them to reset/correct the network configuration for you. Depending on your host there may be a charge for this.
MySQL 5.5 — Lost connection to MySQL server during query
I want to migrate a Web CMS system, called Contao. It’s not my first migration, but my first migration having connection issues with mysql. Migration went successfully, I have the same Contao version running (it’s more or less just copy / paste). For the database behind, I did:
apt-get install mysql-server phpmyadmin
I set a root password and added a user for the CMS which has enough rights on its own database (and only its database) for doing the stuff it has to do. Data import via phpmyadmin worked just fine. I can access the backend of the CMS (which needs to deal with the database already). If I try to access the frontend now, I get the following error:
Fatal error: Uncaught exception Exception with message Query error: Lost connection to MySQL server during query () thrown in /var/www/system/libraries/Database.php on line 686
(Keep in mind: I can access mysql with phpmyadmin and through the backend, working like a charme, it’s just the frontend call causing errors). If I spam F5 in my browser I can sometimes even kill the mysql deamon. If I run
. 120921 7:57:31 [Note] mysqld: ready for connections. Version: '5.5.24-0ubuntu0.12.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu) 05:57:37 UTC - mysqld got signal 4 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail. key_buffer_size=16777216 read_buffer_size=131072 max_used_connections=1 max_threads=151 thread_count=1 connection_count=1 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 346679 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. Thread pointer: 0x7f1485db3b20 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong. stack_bottom = 7f1480041e60 thread_stack 0x30000 mysqld(my_print_stacktrace+0x29)[0x7f1483b96459] mysqld(handle_fatal_signal+0x483)[0x7f1483a5c1d3] /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7f1482797cb0] /lib/x86_64-linux-gnu/libm.so.6(+0x42e11)[0x7f14821cae11] mysqld(_ZN10SQL_SELECT17test_quick_selectEP3THD6BitmapILj64EEyyb+0x1368)[0x7f1483b26cb8] mysqld(+0x33116a)[0x7f148397916a] mysqld(_ZN4JOIN8optimizeEv+0x558)[0x7f148397d3e8] mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0xdd)[0x7f148397fd7d] mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x17c)[0x7f1483985d2c] mysqld(+0x2f4524)[0x7f148393c524] mysqld(_Z21mysql_execute_commandP3THD+0x293e)[0x7f14839451de] mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x10f)[0x7f1483948bef] mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x1365)[0x7f148394a025] mysqld(_Z24do_handle_one_connectionP3THD+0x1bd)[0x7f14839ec7cd] mysqld(handle_one_connection+0x50)[0x7f14839ec830] /lib/x86_64-linux-gnu/libpthread.so.0(+0x7e9a)[0x7f148278fe9a] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f1481eba4bd] Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (7f1464004b60): is an invalid pointer Connection ID (thread ID): 1 Status: NOT_KILLED
Sep 21 07:17:01 s16477249 CRON[23855]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly) Sep 21 07:18:51 s16477249 kernel: [231923.349159] type=1400 audit(1348204731.333:70): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=23946 comm="apparmor_parser" Sep 21 07:18:53 s16477249 /etc/mysql/debian-start[23990]: Upgrading MySQL tables if necessary. Sep 21 07:18:53 s16477249 /etc/mysql/debian-start[23993]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored Sep 21 07:18:53 s16477249 /etc/mysql/debian-start[23993]: Looking for 'mysql' as: /usr/bin/mysql Sep 21 07:18:53 s16477249 /etc/mysql/debian-start[23993]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck Sep 21 07:18:53 s16477249 /etc/mysql/debian-start[23993]: This installation of MySQL is already upgraded to 5.5.24, use --force if you still need to run mysql_upgrade Sep 21 07:18:53 s16477249 /etc/mysql/debian-start[24004]: Checking for insecure root accounts. Sep 21 07:18:53 s16477249 /etc/mysql/debian-start[24009]: Triggering myisam-recover for all MyISAM tables
sudo service mysql start sudo service mysql stop
After using google a little bit, I experimented a little bit with timeouts, correct socket path in the /etc/mysql/my.cnf file, but nothing helped. There are some old (from 2008) Gentoo bugs, where re-compiling just solved the problem. I already re-installed mysql via:
sudo apt-get remove mysql-server mysql-common sudo apt-get autoremove sudo apt-get install mysql-server
without any results. This is the first time I’m running into this problem, and I’m not very experienced with this kind of mysql ‘administration’. So mainly, I want to know if anyone of you could help me out please 🙂 Is it a mysql bug? Is something broken in the Ubuntu repositories? Is this one of those misterious ‘use-tcp-connection-instead-of-socket-stuff-because-there-are-problems-on-virtualized-machines-with-sockets’-problem? Or am I completly on the wrong way and I just miss-configured something? Remember, phpmyadmin and access to the backend (which uses the database, too) is just fine. Maybe something with Apache? What can I do? Any help is appreciated, so thanks in advance 🙂 Edit: I tried using tcp protocol instead of a local socket, like described here. Unfortunately, it changed nothing. Any idea anyone of you?
SCP Lost Connection [closed]
Questions describing a problem that can’t be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers.
I can successfully connect to my server via ssh but when trying to run the scp command I get a connection time out.
$ scp ~/.ssh/id_rsa.pub root@192.168.12.2:id_rsa.pub ssh: connect to host 192.168.12.2 port 22: Connection timed out lost connection
Yes I do have openssh-client and openssh-server installed on both my machines the client and the server. My router is also configured to forward ssh port 22 and no I don’t have a firewall enabled.
That’s very weird. Because scp works by running ssh . While its sitting there (before the timeout) you should be able to catch the ssh command via ps x | grep scp or similar. Does that command work if you run it directly, minus the scp -t . at the end?
I’m confused by your comment that it works on the server side but not the client side? I thought we were only trying from one side. Does ssh (client) work from the side you’re running scp on?
I go it working again, but with a different authentication key, the previous one had a password for encryption reasons and then well I took it off.
Is this solved? It is a bit hard to tell from your last comment. I think that derobert’s suggestion is a good one. From the ssh_config man page: ClearAllForwardings — Specifies that all local, remote, and dynamic port forwardings specified in the configuration files or on the command line be cleared. This option is primarily useful when used from the ssh command line to clear port forwardings set in configuration files and is automatically set by scp(1) and sftp(1). The argument must be yes or no. The default is no.
How to Fix MySQL Lost Connection
In some cases when working with MySQL databases, you may encounter the “Error 2013: Lost connection to MySQL server during query” error. Although this can be frustrating when it happens, there is relatively simple reason why it happens and how you can fix it.
What Causes “Lost Connection to MySQL Server During Query” Error?
This type of error occurs when the connection between a client and the server exceeds the specified timeout value.
For example, if you have a long query that takes a long time to complete the execution, MySQL drops the connection to the server.
Take for example, when exporting a large database, depending on the export method and the data to be exported, it can take a long time for this process to complete. To prevent the issues on the server, MySQL can terminate this connection before the process completion.
Another common cause of this type of error is the complex join operations.
MySQL Show Timeout Value
As mentioned, you can fix this type of error by simply increasing the timeout durations on the server side.
The timeout values are stored in the wait_timeout and interactive_timeout variables. We can fetch the current values as shown in the following queries:
The resulting output is as follows:
The given result shows the default value of the interactive_timeout variable. This value defines the duration, in seconds, that the server waits for an activity on an active session before terminating it.
We can also fetch the value of wait_timeout variable as:
This variable sets the duration that the MySQL server waits for an activity in a non-interactive session.
Fix MySQL Lost Connection Error by Updating the Timeout Variables
To fix this type of error, we can update the values of the two variables discussed previously. We can run the query as shown in the following:
The previous command should update the value of the interactive_timeout variable to 43200 seconds.
To update the wait_timeout parameter, run the following command:
You are done. You can try re-running your timed query.
Conclusion
In this post, we discussed the cause of connection lost error when working with MySQL and the steps that you can take to fix them. However, be mindful of your queries or segment them into efficient blocks.
Thanks for reading and happy coding!
About the author
John Otieno
My name is John and am a fellow geek like you. I am passionate about all things computers from Hardware, Operating systems to Programming. My dream is to share my knowledge with the world and help out fellow geeks. Follow my content by subscribing to LinuxHint mailing list