473,382 Members | 1,204 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Can't Move MySQL Datadir

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?
Jul 19 '05 #1
0 3923

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Evan Barter | last post by:
I've noticed a server running with a higher load recently and I believe I've narrowed it down to mySQL. Taking a look at Cpu/Memory/Mysql Usage History in WebHost Manager I notice this: User ...
0
by: flubdgub | last post by:
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...
0
by: Mark Adams | last post by:
I really need some help with this. MySQL will not start on boot despite everything I've done to make sure that it is set to do so. When I start it as root from a terminal with...
0
by: Arthur Perry | last post by:
Hello, I am having this problem that is just driving me crazy.. When using Bugzilla with Mysql (all Mysql, Perl, and modules all supplied by RedHat for RHEL 3.0), MYSQL hangs frequently. I have...
1
by: Maxim. V. | last post by:
Hello to everone, As mentioned in this *guide(1), i've compiled mysql on my fedora Core 2 system, with the following spec's : *(1) http://hulan.info/blog/index.php?itemid=576 ...
0
by: ./Rob & | last post by:
Hi gang: I'm experiencing a problem with MySQL -- I updated MySQL from version 4.1.0 to 4.1.10 and now when I login as root it doesn't show all the databases I should have access to, nor it...
16
by: MLH | last post by:
Using MS Access, I have attached to MySQL servers in other states and other countries on the other side of my router. But when I use the MySQL ODBC driver 3.51 to connect to a MySQL server on my...
1
by: jlee | last post by:
I'm pretty much a newbie on mysql, and I need some help. I am running mysql Ver 12.22 Distrib 4.0.24, for portbld-freebsd5.4 (i386) on a server hosting an active website. The site's developer...
3
by: eieiohh | last post by:
MySQL 3.23.49 PHP 4.3.8 Apache 2.0.51 Hi All! Newbie.. I had a CRM Open Source application installed and running. Windows Xp crashed. I was able to copy the contents of the entire hard...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.