Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 MySQL Servers Missing Databases

Status
Not open for further replies.

cbweb

Programmer
Apr 25, 2002
3
GB
OK, anyone got dig out for the following:

MySQL connects to 2 databases mysql and test in /var/lib/mysql I also
see a mysql.sock in this folder. I can connect remotely but not from
the command line to the 2 databases.This would appear to be a fresh
version of mySQL (don't ask how it got there or how it has replaced
another version as dunno the answer to that:0( )

Unfortunately my databasesreside in another folder usr/local/mysql/var
and I can't connect to them locally or remotely and I see no socket
file in this folder.

There is an url for
managing multi versions of the server configured by changing the
my.cnf file and placing a copy of it in /etc

Included in my.cnf would be something like:

#This is an example of the config file on behalf of mysqld_multi.

# This file should probably be in your home dir (~/.my.cnf)
#or /etc/my.cnf
# Version 2.1 by Jani Tolonen

[mysqld_multi]
mysqld = /usr/local/bin/mysqld_safe
mysqladmin = /usr/local/bin/mysqladmin
user = multi_admin
password = multipass

[mysqld2]
socket = /tmp/mysql.sock2
port = 3307
pid-file = /usr/local/mysql/var2/hostname.pid2
datadir = /usr/local/mysql/var2
language = /usr/local/share/mysql/english
user = john

[mysqld3]
socket = /tmp/mysql.sock3
port = 3308
pid-file = /usr/local/mysql/var3/hostname.pid3
datadir = /usr/local/mysql/var3
language = /usr/local/share/mysql/swedish
user = monty


However, in my case it seems a new server has acquired the 3306 port,
installed it's new socket file and knocked out the one use by the
previous one.

Is there anyway to get back the old server, connect to it locally and
remotely.

If not the above, minimum I urgently need is to get the previous
databases up and working with the new MySQL which only sees test and
mysql. In which case, can I simply copy across the databases from the
old folder and into the folder of mysql and test using

mv -i /usr/local/mysql/var /var/lib/mysql


cheers


Colm
 
Yep, sounds to me like someone has performed another installation of MySQL on that server.

One thing you can do is create new blank databases on the new server with the same names as on the old. Then copy the table files into the new database directory created.


Want the best answers? Ask the best questions: TANSTAAFL!
 
Hi,

To copy table files would I not have to have MySQL running
to access those original tables and issue commands from the shell to export the tables into a file? I did try similar idea to move the database files across to new folder having turned off MySQL. I restarted MySQL but got various messages from MySQL that the data in those files could not be read...no permission messages, pity MySQL seems to have no mechanism to import databases...

cheers

Colm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top