Thank you very much. that was a real life saver.
u rock :)
Regards
Kaustubh

----Original Message Follows----
From: Thomas Spahni <[EMAIL PROTECTED]>
To: kaustubh shinde <[EMAIL PROTECTED]>
CC: mysql@lists.mysql.com
Subject: Re: where is my data?
Date: Mon, 4 Apr 2005 12:03:05 +0200 (CEST)

Hi,

check the script /etc/rc.d/mysql which is the SuSE equivalent to
mysqld_safe.

That's where they set datadir= and you have to change this to reflect
your new path. Change the paths to the socket and pid file as well.

There should be no problem to move all data to a new place and start
the server giving the new datadir on the command line. Then you do

host:/etc/rc.d # ./mysql start

If you are going to use mysqld_safe then its something like:

prompt> mysqld_safe --datadir=/data/mysql/mysqldata --user=mysql \
        --pid-file=/data/mysql/mysqldata/mysqld.pid \
        socket=/data/mysql/mysqldata/mysql.sock

Regards,
Thomas Spahni


On Sat, 2 Apr 2005, kaustubh shinde wrote:

> Hi,
> I have suse 9.2 and MySQL 4.21
> My basedir is /var/lib/mysql
> datadir /data/mysql/mysqldata
> Both the directories and subdirectories and files are owned by user mysq,l
> group mysql with rights 755. So I guess I have got the permissions part
> right or so I hope.
> Everything was working fine till I decided to move the data directory from
> its previous location to the above one.
> I had millions of problems after moving the data directory and the database
> won't start at all.
> Just to make things work I made the base and data dirs 777. Finally, I can
> now start it using `mysql.server start`
> But the good part ends here. I can only see mysql and test databases and i
> have to log on as root to mysql. My earlier users and databases won't show.
> Although I have the datafiles at the specified location. This might be coz
> I ran mysql_install_db again. If I change the rights of base and data dirs
> to 755, it won't work.
>
> I still can't start using mysqld_safe.
>
> My /etc/my.cnf has following:
>
> [mysqld]
> port = 3306
> socket = /var/lib/mysql/mysql.sock
> user=mysql
> datadir=/data/mysql/mysqldata
> bdb_home=/data/mysql/mysqldata
>
> [mysql_server]
> basedir = /var/lib/mysql
>
> [mysql.server]
> basedir = /var/lib/mysql
>
> [mysqld_safe]
> err-log=/var/lib/mysql/mysqld.log
>
>
> innodb_data_home_dir=/data/mysql/mysqldata
> innodb_data_file_path=ibdata1:10M:autoextend
> innodb_log_group_home_dir=/data/mysql/
> innodb_log_arch_dir=/data/mysql/
>
> and so on..
> anyway, so this my.cnf doesn't seem to make any difference. when i try
>
> mysqld_safe & it gives
>
> Starting mysqld-max daemon with databases from /var/lib/mysql
> /usr/bin/mysqld_safe: line 307: /var/lib/mysql/www.eh3.uc.edu.err:
> Permission denied
> /usr/bin/mysqld_safe: line 313: /var/lib/mysql/www.eh3.uc.edu.err:
> Permission denied
> STOPPING server from pid file /var/lib/mysql/www.eh3.uc.edu.pid
> tee: /var/lib/mysql/www.eh3.uc.edu.err: Permission denied
> 050402 07:39:03 mysqld ended
> tee: /var/lib/mysql/www.eh3.uc.edu.err: Permission denied
>
>
> So I try mysqld_safe --user=mysql --err-log=/var/lib/mysql/mysqld.log &
> and I get
>
> 050402 07:40:29 mysqld started
> 050402 7:40:29 InnoDB: Started
> 050402 7:40:29 Fatal error: Can't open privilege tables: Table 'mysql.host'
> doesn't exist
> 050402 7:40:29 Aborting
>
> 050402 7:40:29 InnoDB: Starting shutdown...
> 050402 7:40:31 InnoDB: Shutdown completed
> 050402 7:40:31 /usr/sbin/mysqld-max: Shutdown Complete
>
> 050402 07:40:31 mysqld ended
>
>
> and when i try to specify basedir with above command like
> mysqld_safe --user=mysql --err-log=/var/lib/mysql/mysqld.log
> --basedir=/var/lib/mysql &
>
> i get
> 050402 07:38:28 mysqld started
> 050402 7:38:28 Can't find messagefile
> '/var/lib/mysql/share/mysql/english/errmsg.sys'
> 050402 7:38:28 Aborting
>
> 050402 07:38:28 mysqld ended
>
> wonderful!!!!!!!!
>
> >From what I understand, mysqld_safe is supposed to read these options from
> my.cnf. but its not and i have to specify them on command line.
>
> I have spent 4 days and sacrificed an enticing surfing trip on this and feel
> like i m the dumbest guy on face of earth. every problem seem to spawn off a
> new one as soon as its solved..
>
> I will really appreciate if someone could just point out the exact problem
> to me and give a direction.
>
> Thanks in advance
> Kaustubh
>
> _________________________________________________________________
> Screensavers unlimited! http://www.msn.co.in/Download/screensaver/ Download
> now!
>
>
>



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]


_________________________________________________________________
The MSN Survey! http://www.cross-tab.com/surveys/run/test.asp?sid=2026&respid=1 Help us help you better!



-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to