Hi there, I want to do something ridiculously simple and naturally
MySQL is presenting me with problems that the manual doesn't even hint
at.
Platform is Debian Linux 2.4.21
All I want to do is change the datadir in /etc/mysql/my.cnf from
/var/lib/mysql to /DB.
I attempted this as follows:
1. Shut down mysql ( /etc/init.d/mysql stop )
Shuts down fine
2. Modify /etc/mysql/my.cnf
datadir = /DB
#datadir = /var/lib/mysql
3. Copied the contents with permissions preservation from
/var/lib/mysql to /DB
4. Restarted MySQL... Guess what, it doesn't work.
---------------------------------------------------
# /etc/init.d/mysql start
Starting MySQL database server: mysqld...failed.
---------------------------------------------------
Sez it failed but the processes are running:
root 2383 0.0 0.0 1996 976 pts/3 S 17:20 0:00 /bin/sh
/usr/bin/safe_mysqld
mysql 2418 0.0 0.1 36592 4440 pts/3 S 17:20 0:00
/usr/sbin/mysqld --basedir=/usr --datadir=/DB --user=mysql
--pid-file=/var/run/mysqld/mysqld.pid --skip-locking
mysql 2420 0.0 0.1 36592 4440 pts/3 S 17:20 0:00
/usr/sbin/mysqld --basedir=/usr --datadir=/DB --user=mysql
--pid-file=/var/run/mysqld/mysqld.pid --skip-locking
mysql 2421 0.0 0.1 36592 4440 pts/3 S 17:20 0:00
/usr/sbin/mysqld --basedir=/usr --datadir=/DB --user=mysql
--pid-file=/var/run/mysqld/mysqld.pid --skip-locking
mysql 2422 0.0 0.1 36592 4440 pts/3 S 17:20 0:00
/usr/sbin/mysqld --basedir=/usr --datadir=/DB --user=mysql
--pid-file=/var/run/mysqld/mysqld.pid --skip-locking
-----------------------------
If I try to connect, it sez I don't have permissions:
ERROR 1045: Access denied for user: 'root@localhost' (Using password:
NO)
It's as if the mysql DB is missing, but it's not it's in the right
place (/DB) with all the right permissions.
All the instructions I can find on the web say I did what I was
supposed to. If I change the datadir back and restart everything is
fine. The MySQL manual was no help. Can someone please give me some
ideas?