Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have Ubuntu server running in a VMWare 6.5.2 virtual machine. I made a straight file copy of the entire VM folder structure to my laptop from my desktop and then booted it up.

After the VM guest OS boots, things are a little wonky. In particular, mysql won't start, and all my localhost'd files come up 404, even the root index.

Any ideas?

Edit - To clarify, I copied the Virtual Machine files located in the Host Windows computer's file system from my Desktop computer to my Laptop computer, and then opened the copied files in VMware on the laptop.

Here are the mysql error logs from syslog:

Jul 23 11:51:03 ubuntu mysqld_safe[9194]: started
Jul 23 11:51:03 ubuntu mysqld[9197]: 090723 11:51:03  InnoDB: Started; log sequence number 0 8539038
Jul 23 11:51:03 ubuntu mysqld[9197]: 090723 11:51:03 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address
Jul 23 11:51:03 ubuntu mysqld[9197]: 090723 11:51:03 [ERROR] Do you already have another mysqld server running on port: 3306 ?
Jul 23 11:51:03 ubuntu mysqld[9197]: 090723 11:51:03 [ERROR] Aborting
Jul 23 11:51:03 ubuntu mysqld[9197]: 
Jul 23 11:51:03 ubuntu mysqld[9197]: 090723 11:51:03  InnoDB: Starting shutdown...
Jul 23 11:51:04 ubuntu mysqld[9197]: 090723 11:51:04  InnoDB: Shutdown completed; log sequence number 0 8539038
Jul 23 11:51:04 ubuntu mysqld[9197]: 090723 11:51:04 [Note] /usr/sbin/mysqld: Shutdown complete
Jul 23 11:51:04 ubuntu mysqld[9197]: 
Jul 23 11:51:04 ubuntu mysqld_safe[9218]: ended
Jul 23 11:51:17 ubuntu /etc/init.d/mysql[9360]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Jul 23 11:51:17 ubuntu /etc/init.d/mysql[9360]: ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
Jul 23 11:51:17 ubuntu /etc/init.d/mysql[9360]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Jul 23 11:51:17 ubuntu /etc/init.d/mysql[9360]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Jul 23 11:51:17 ubuntu /etc/init.d/mysql[9360]:

Here are the apache error logs. Regardless of what localhost url I try to open, the same error line is output:

[Thu Jul 23 11:57:38 2009] [error] [client 127.0.0.1] File does not exist: /htdocs
[Thu Jul 23 11:59:53 2009] [error] [client 127.0.0.1] File does not exist: /htdocs
[Thu Jul 23 11:59:59 2009] [error] [client 127.0.0.1] File does not exist: /htdocs
[Thu Jul 23 12:00:04 2009] [error] [client 127.0.0.1] File does not exist: /htdocs
share|improve this question
    
Please clarify: (1) how did you do this file copy, and did you copy the virtual machine image, or did you copy the files that Linux sees, inside the virtual machine (/etc, /bin, /usr, etc.)? (2) What error messages does MySQL give when refusing to start (check log files)? –  derobert Jul 24 '09 at 1:23

3 Answers 3

This could be an issue with udev...., The name of the ethernet card is based upon the mac address of the interface. If the mac address has changed ( which I would expect if it is a new machine with copied discs ) then the working ethernet cards would have new names, and the old ones which are configured would no longer exist/come up.

Showing the output of /sbin/ifconfig will help show one way or another. The contents of /etc/network/interfaces and /etc/hosts would be interesting

share|improve this answer

"Do you already have another mysqld server running on port: 3306 ?"

looks like you already have a version of mysql running, do a "ps ax | grep mysql" to see, you can also "telnet localhost 3306"

look in your httpd.conf or equivalent and find where your document root is then confirm you have copied the files to the correct place, also check the file permissions after copying with ls -l, the files need to be readable by the apache user

share|improve this answer
    
Here's the output of ps ax|grep mysql: dev@ubuntu:~$ ps ax|grep mysql 3989 pts/0 S+ 0:00 grep mysql dev@ubuntu:~$ ... no mysql running. The file /etc/apache2/sites-available/default shows my docroot as /var/www, which is what it should be and is where my html docs are located. The primarily weird this about this is that I just copied the VMware image to another computer and booted it up, and all these things just stopped working. Very weird. –  Ian Jul 24 '09 at 21:21
    
that makes more sense, it first sounded like you just copied the files. when you booted it do you have network connectivity? if the hostname has changed or the network does not start mysql has problems starting. However that output you gave before from your error logs shows a process using 3306? what happens when you "telnet localhost 3306" ? –  stuart Brand Jul 24 '09 at 22:44
    
connection refused when attempting to telnet to 3306. listing all open ports does not show 3306 as open. –  Ian Jul 25 '09 at 0:08
    
Is your MySQL configured to bind to a certain IP address? If so, is that IP address present? –  derobert Jul 25 '09 at 1:00
    
that doesn't make sense? mysql will not start because it complains the port is in use, however when you telnet to the port there is no connection? whats the output and log messages from "/etc/init.d/mysql start" now? –  stuart Brand Jul 25 '09 at 5:16

First off, the IP is likely changed if you copied your virtual machine. Find you my.cnf and change the bind to localhost or the new IP.

Next you may have some permission issues, make a symbolic link /tmp/mysqld.sock > mysqld.sock

cd /tmp
sudo ln -s /var/run/mysqld/mysqld.sock mysqld.sock
sudo /etc/init.d/mysql start &
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.