Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
10-05-2005, 01:21 PM
|
#1
|
Member
Registered: May 2005
Posts: 255
Rep:
|
MYSQL data dir
I have slackware 10.2 and windows. I want to have Windows and Mysql to share the data dir. I have the data dir i want them to share at /machination/data/ . How can I set mysql up in Slackware ( I already did it in Windows) to use that data dir which contains all the databases etc? Thanks
I was following one guide and renamed my-medium.cnf to my.cnf and adding 'datadir=/machination/data/' but it still loads the default data dir 
Last edited by android6011; 10-05-2005 at 01:27 PM.
|
|
|
10-05-2005, 02:36 PM
|
#2
|
Member
Registered: Jul 2004
Location: UK
Distribution: Fedora, Gentoo, Redhat Enterprise
Posts: 141
Rep:
|
You can set the location of the base directory which contains the databases in /etc/my.cnf.
|
|
|
10-05-2005, 04:35 PM
|
#3
|
Member
Registered: May 2005
Posts: 255
Original Poster
Rep:
|
what do I change in the my.cnf to point to the new base dir?
|
|
|
10-06-2005, 05:25 AM
|
#4
|
Member
Registered: Jul 2004
Location: UK
Distribution: Fedora, Gentoo, Redhat Enterprise
Posts: 141
Rep:
|
well my file looks like this
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
[mysql.server]
user=mysql
basedir=/var/lib
[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
So just change the datadir=/var/lib/mysql line to your new location., I would also suggest you merge the contents of the old directory into the new one, so you don't loose anything.
BTW I've never tried this so if someone else knows different feel free to add a comment.
|
|
|
10-06-2005, 06:53 PM
|
#5
|
Member
Registered: May 2005
Posts: 255
Original Poster
Rep:
|
still doesnt load the correct database location  so frustrating !
|
|
|
10-06-2005, 07:50 PM
|
#6
|
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
|
There is actually an easier way. For each database in /var/lib/mysql, replace the database directory with a soft link pointing to the directory you actually want it to use.
So say you have database1 in /var/lib/mysql but you want to use database1 in /machination/data. Backup database1 first (just in case) then delete the directory from /var/lib/mysql. Then add the softlink in /var/lib/mysql
ln -s /machincation/data/database1 database1
when you run ls -l you should see the link pointing to the right place and mysql should be using the database in /machination/data
Of course instead of doing it on a database by database method, you could always have the mysql directory be a softlink pointing somewhere else
Last edited by Hangdog42; 10-06-2005 at 07:52 PM.
|
|
|
10-07-2005, 11:10 AM
|
#7
|
Member
Registered: May 2005
Posts: 255
Original Poster
Rep:
|
how do i make a soft link?
|
|
|
10-07-2005, 11:21 AM
|
#8
|
Member
Registered: May 2005
Posts: 255
Original Poster
Rep:
|
i did that now I get "Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid
051007 11:21:19 mysqld ended
"
|
|
|
10-07-2005, 11:42 AM
|
#9
|
Member
Registered: May 2005
Posts: 255
Original Poster
Rep:
|
i should have added this earlier but I want the two mysqls to share everything. the reason being is I have different users. Just sharing the one database isnt going to do anything for the other users. 
|
|
|
10-07-2005, 01:20 PM
|
#10
|
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
|
OK, if you want them to share all the databases, then you have to have /var/lib/mysql be a softlink pointing to wherever you want the databases to really be. And you use the ln command to create that link.
As for mysqld not starting, we are going to need to know more. Check in the .err file in /var/log/mysql for more information.
One final note....I'm not so sure that having two separate daemons working off of the same database is such a good idea. It would probably be best to set up one system as a server and then connect to that server when you need database access.
|
|
|
10-07-2005, 01:28 PM
|
#11
|
Member
Registered: May 2005
Posts: 255
Original Poster
Rep:
|
051007 13:25:07 mysqld started
/usr/libexec/mysqld: File './localhost-bin.000017' not found (Errcode: 13)
051007 13:25:08 [ERROR] Could not use localhost-bin for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
051007 13:25:08 [ERROR] Aborting
051007 13:25:08 [Note] /usr/libexec/mysqld: Shutdown complete
051007 13:25:08 mysqld ended
i deleted all the sql users but root so im al lset that way. The two daemons arnt on two diff amchines, im dual booting windows and linux, thats why im trying to run lamp and wamp so i can go between them and still have my site up
|
|
|
10-07-2005, 01:44 PM
|
#12
|
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
|
OK, Since Windows only reads its own file system, I'm assuming that the databases are on a Windows FAT32 partition (please correct me if I'm wrong). Does the Linux user that mysql runs under have read and write permissions on that partition?
|
|
|
10-07-2005, 04:04 PM
|
#13
|
Member
Registered: May 2005
Posts: 255
Original Poster
Rep:
|
yes, because i can write to my htdocs, so i assume it has rights to the data folder
|
|
|
10-08-2005, 08:49 AM
|
#14
|
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
|
Quote:
Originally posted by android6011
yes, because i can write to my htdocs, so i assume it has rights to the data folder
|
OK, now you've got me completely confused. What does htdocs have to do with the mysql directory? Htdocs is for Apache, not mysql, and it is highly likely that Apache is running under a different user than mysql. I know I have them running under different users.
The bottom line is that something basic is going wrong here. The earlier suggestions you got from Simon should have worked and the linking should have worked also. I'm going to suggest trying one of two things:
1) Blow away the Windows data by copying everything (and I mean everything) in /var/lib/mysql to the windows partition and make sure that /var/lib/mysql is a soft link pointing to that Windows partition
2) Uninstall mysql, clean out all the directories, and then reinstall. But before starting it, edit the my.cnf file to point to the partition you want.
|
|
|
10-08-2005, 11:05 AM
|
#15
|
Member
Registered: May 2005
Posts: 255
Original Poster
Rep:
|
I was just saying the htdocs is on the same partition with the sql data and i can write to the htdocs so i doubt it is a permission problem. Ill try doing what you said and repost when im done
|
|
|
All times are GMT -5. The time now is 02:52 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|