Re: [newbie] MySQL File Location
SOTL wrote: Well I change the datadir in mysql-max and I have generated numerous versions of my.cnf directing MySQL to my desired directory each change causing MySQL refused to run. So I keep playing around with mysql-max and found that there is a second place where the config file does a test of the datadir so I changed that. At that point MySQL would open and did switch data directories. Continued to play with MySQL, making and deleting DB et. i.e. all the things a newbie does with a book and a new program. Then, I shut the box down for the night and went home. It is after all only a test box at this time but it is damn noise so to keep the piece down it goes. Anyway, firing it up the next afternoon I was amassed to discover that MySQL would not open with the same old error message that it could not find the data directory. I the reset the data directory to the original settings and MySQL again started working. So, there are at least 3 places that you MUST change the data directory at in configuration files in order to change the data directory. Best best is to do it by symbolic link as no newbie is going to figure out how to do it in configuration files. My only comment: How quaint, how 1950s that there exist programs in which one can not select the data directory. Frank PS. Thanks for the help. It is definitely appreciated. Frank, One thing to keep in mind, when changing things in the file in /etc/rc.d/init.d - You have to stop and restart MySQL before they take effect. The values in the script are only read at startup. You should probably learn about the service command. If you are using mysql, then you would run service mysql start to start it, service mysql stop to stop it, and service mysql restart to test your changes. If you use mysql-max, then use that in mlace of mysql in the service command. You may also be having a problem because on not understanding how the script works. Not every instruction in the script get run. It does tests, and if a value is set, then it skips part of the code. This is why you see references to /etc/my.cnf in the script, even though creating or changing this file has no affect on MySQL. This is because that part of the script does not get accessed on a Mandrake box. So you will want to be carefull aboout changing things in the script. The values that you would want to change are always at the beginning of the line, and normaly have a comment block before them. Mikkel -- Do not meddle in the affairs of dragons, for you are crunchy and taste good with Ketchup! Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com
Re: [newbie] MySQL File Location
SOTL wrote: del Hi All Derek and Mikkel Thanks for the information. Derek sorry I did not mean to be insulting. I simply do not understand and am very happy for your help which I thank you very much for. I have checked I do not have a file called S90MySQL in any location. I especially checked that it does NOT exist at /etc/rc5.d/S90mysql. Nor do I have a file /etc/rc.d/init.d/mysql. What I do have is a file /etc/rc.d/init.d/mysql-max. I had taken a look at this file earlier but dismissed it assuming that it is not the correct file. MySQL-Max was placed on both boxes at one point in time and the removed. On reinstallation of MySQL standard MySQL was installed not MySQL-Max. This may be the source of the configuration file issue. Currently both boxes have MySQL installed. I have printed the MySQL-Max file and it is a 4 1/2 pages #10 font program which I can read some of - not much since I am not a programmer. One interesting thing I did notice is that it refers to checking a configuration file called my.cnf which I do not have. As I know that I do not have the technical expertize to create a my.cnf file I would appreciate someone sending me a copy of a simple one that functions. Thanks Frank The mysql or mysql-max files are the scripts used to start mysql. There are a few config options in the file. The important one for your is the line: datadir=/var/lib/mysql If you want your mysql data someplace other then /var/lib/mysql, then you will need to chege this line. You will want to create a my.cnf file in this directory. It can be an empty file. The script fills in the missing entries with usable defaults. Mikkel -- Do not meddle in the affairs of dragons, for you are crunchy and taste good with Ketchup! Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com
Re: [newbie] MySQL File Location
del Hi All Derek and Mikkel Thanks for the information. Derek sorry I did not mean to be insulting. I simply do not understand and am very happy for your help which I thank you very much for. I have checked I do not have a file called S90MySQL in any location. I especially checked that it does NOT exist at /etc/rc5.d/S90mysql. Nor do I have a file /etc/rc.d/init.d/mysql. What I do have is a file /etc/rc.d/init.d/mysql-max. I had taken a look at this file earlier but dismissed it assuming that it is not the correct file. MySQL-Max was placed on both boxes at one point in time and the removed. On reinstallation of MySQL standard MySQL was installed not MySQL-Max. This may be the source of the configuration file issue. Currently both boxes have MySQL installed. I have printed the MySQL-Max file and it is a 4 1/2 pages #10 font program which I can read some of - not much since I am not a programmer. One interesting thing I did notice is that it refers to checking a configuration file called my.cnf which I do not have. As I know that I do not have the technical expertize to create a my.cnf file I would appreciate someone sending me a copy of a simple one that functions. Thanks Frank The packager who built the Mandrake package for MySQL has created the file /etc/rc5.d/S90mysql to set up the defaults for MySQL so that a my.cnf file is unnecessary. I simply read that file and told you what the defaults were set to. I also told you that by using a symlink to /var/lib/mysql you could put your user data in a different folder without having to edit any files or create a my.cnf file. BTW: A pid file is a file usually kept in /var/run which identifies the Process Identifier number (pid) a daemon is using derek Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com
Re: [newbie] MySQL File Location
SOTL wrote: On Tuesday 15 March 2005 11:21, Derek Jennings wrote: On Tuesday 15 March 2005 14:42, SOTL wrote: Hi All I have created a partition on one of my computer to store critical system data files called /System_Data. I am trying to configure MySQL so that it will use /System_Data as its default file storage. I looked for /etc/my.cnf; found I did not have one so I generated one. My /etc/my.cnf files contains exactly 1 line which is: datadir=/System_Data When I start MySQL I now receive the following error message: Found option without preceding group in config file /etc/my.cnf at line 1. Fatail error in default handling. Program aborted. Would appreciate help in ascertaining what should be added or how current should be modified. Frank It is failing because having created a /etc/my.cnf file it is expecting to find other parameters defined in there in addition to datadir (pid_file=, basedir=/, bindir=/usr/bin ) You could alternatively edit the datadir path in /etc/rc5.d/S90mysql which is the script that starts mysql Alternatively if you create a symlink from /var/lib/mysql to /mnt/System_Data/mysql then you would not need to change any configuration and your data would go in the folder you desire. BTW: In Linux /var is the default directory to hold data so why do you need to define a different one? derek Hi All and thanks Derek I have finally gotten back to the above issue in my attempts to resolve my setup issues. I have printed the instructions for Using Option Files as kindly pointed out to me by David G Stevenson located at: http://dev.mysql.com/doc/mysql/en/option-files.html If I understand Derek correctly my.cnf should look something like [mysql] datadir=/System_Data basedir=/ bindir=/usr/bin pid_file= This raises two issues to me. First what is a 'pid_file=' ? And where is it located? Second I do not find pid_file, basedir, or bindir mentioned in the MySQL Reference Manual:: 4.3.2 Using Option Files. Thus to say the least I am confused. if someone would mind enlighten me on correct procedure I would appreciate it. Thank Frank You may want to take a look at /etc/rc.d/init.d/mysql to see were a lot of things are by default, and how they are set. If you leave pid_file= blank, it gets set in this file. The file gets created when mysql starts, and contains the Program ID (PID) of the MySQL server. Looking at this file, it looks like this is where you would set your data directory, and you would put my.cfg in the data directory you set in this file. Mikkel -- Do not meddle in the affairs of dragons, for you are crunchy and taste good with Ketchup! Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com
Re: [newbie] MySQL File Location
On Monday 21 March 2005 22:31, SOTL wrote: On Tuesday 15 March 2005 11:21, Derek Jennings wrote: On Tuesday 15 March 2005 14:42, SOTL wrote: Hi All I have created a partition on one of my computer to store critical system data files called /System_Data. I am trying to configure MySQL so that it will use /System_Data as its default file storage. I looked for /etc/my.cnf; found I did not have one so I generated one. My /etc/my.cnf files contains exactly 1 line which is: datadir=/System_Data When I start MySQL I now receive the following error message: Found option without preceding group in config file /etc/my.cnf at line 1. Fatail error in default handling. Program aborted. Would appreciate help in ascertaining what should be added or how current should be modified. Frank It is failing because having created a /etc/my.cnf file it is expecting to find other parameters defined in there in addition to datadir (pid_file=, basedir=/, bindir=/usr/bin ) You could alternatively edit the datadir path in /etc/rc5.d/S90mysql which is the script that starts mysql Alternatively if you create a symlink from /var/lib/mysql to /mnt/System_Data/mysql then you would not need to change any configuration and your data would go in the folder you desire. BTW: In Linux /var is the default directory to hold data so why do you need to define a different one? derek Hi All and thanks Derek I have finally gotten back to the above issue in my attempts to resolve my setup issues. I have printed the instructions for Using Option Files as kindly pointed out to me by David G Stevenson located at: http://dev.mysql.com/doc/mysql/en/option-files.html If I understand Derek correctly my.cnf should look something like [mysql] datadir=/System_Data basedir=/ bindir=/usr/bin pid_file= This raises two issues to me. First what is a 'pid_file=' ? And where is it located? Second I do not find pid_file, basedir, or bindir mentioned in the MySQL Reference Manual:: 4.3.2 Using Option Files. Thus to say the least I am confused. if someone would mind enlighten me on correct procedure I would appreciate it. Thank Frank The packager who built the Mandrake package for MySQL has created the file /etc/rc5.d/S90mysql to set up the defaults for MySQL so that a my.cnf file is unnecessary. I simply read that file and told you what the defaults were set to. I also told you that by using a symlink to /var/lib/mysql you could put your user data in a different folder without having to edit any files or create a my.cnf file. BTW: A pid file is a file usually kept in /var/run which identifies the Process Identifier number (pid) a daemon is using derek -- www.jennings.homelinux.net http://twiki.mdklinuxfaq.org Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com
Re: [newbie] MySQL File Location
Derek Jennings wrote: The packager who built the Mandrake package for MySQL has created the file /etc/rc5.d/S90mysql to set up the defaults for MySQL so that a my.cnf file is unnecessary. I simply read that file and told you what the defaults were set to. I also told you that by using a symlink to /var/lib/mysql you could put your user data in a different folder without having to edit any files or create a my.cnf file. BTW: A pid file is a file usually kept in /var/run which identifies the Process Identifier number (pid) a daemon is using derek Minnor correction - the file is actualy /etc/rc.d/init.d/mysql. The files in /etc/rc.d/rc#.d are symlinks to the files in /etc/rc.d/init.d and are created/removed by chkconfig. The /etc/rc#.d entries are symlinks to the directories in /etc/rc.d. If you would like to know more about this, you may want to read /usr/share/doc/initscripts-7.61.1/sysvinitfiles. Mikkel -- Do not meddle in the affairs of dragons, for you are crunchy and taste good with Ketchup! Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com
[newbie] MySQL File Location
Hi All I have created a partition on one of my computer to store critical system data files called /mnt/System_Data. I am trying to configure MySQL so that it will use /mnt/System_Data as its default file storage. I looked for /etc/my.cnf; found I did not have one so I generated one. My /etc/my.cnf files contains exactly 1 line which is: datadir=/mnt/System_Data When I start MySQL I now receive the following error message: Found option without preceding group in config file /etc/my.cnf at line 1. Fatail error in default handling. Program aborted. Would appreciate help in ascertaining what should be added or how current should be modified. Frank Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com
Re: [newbie] MySQL File Location
On Tuesday 15 March 2005 14:42, SOTL wrote: Hi All I have created a partition on one of my computer to store critical system data files called /mnt/System_Data. I am trying to configure MySQL so that it will use /mnt/System_Data as its default file storage. I looked for /etc/my.cnf; found I did not have one so I generated one. My /etc/my.cnf files contains exactly 1 line which is: datadir=/mnt/System_Data When I start MySQL I now receive the following error message: Found option without preceding group in config file /etc/my.cnf at line 1. Fatail error in default handling. Program aborted. Would appreciate help in ascertaining what should be added or how current should be modified. Frank It is failing because having created a /etc/my.cnf file it is expecting to find other parameters defined in there in addition to datadir (pid_file=, basedir=/, bindir=/usr/bin ) You could alternatively edit the datadir path in /etc/rc5.d/S90mysql which is the script that starts mysql Alternatively if you create a symlink from /var/lib/mysql to /mnt/System_Data/mysql then you would not need to change any configuration and your data would go in the folder you desire. BTW: In Linux /var is the default directory to hold data so why do you need to define a different one? derek -- www.jennings.homelinux.net http://twiki.mdklinuxfaq.org Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com
Re: [newbie] MySQL File Location
On Tuesday 15 March 2005 11:21, Derek Jennings wrote: On Tuesday 15 March 2005 14:42, SOTL wrote: Hi All I have created a partition on one of my computer to store critical system data files called /mnt/System_Data. I am trying to configure MySQL so that it will use /mnt/System_Data as its default file storage. I looked for /etc/my.cnf; found I did not have one so I generated one. My /etc/my.cnf files contains exactly 1 line which is: datadir=/mnt/System_Data When I start MySQL I now receive the following error message: Found option without preceding group in config file /etc/my.cnf at line 1. Fatail error in default handling. Program aborted. Would appreciate help in ascertaining what should be added or how current should be modified. Frank It is failing because having created a /etc/my.cnf file it is expecting to find other parameters defined in there in addition to datadir (pid_file=, basedir=/, bindir=/usr/bin ) You could alternatively edit the datadir path in /etc/rc5.d/S90mysql which is the script that starts mysql Alternatively if you create a symlink from /var/lib/mysql to /mnt/System_Data/mysql then you would not need to change any configuration and your data would go in the folder you desire. BTW: In Linux /var is the default directory to hold data so why do you need to define a different one? derek Well I changed the file to be [MYSQL] datadir=/mnt/System_Data and I got: Error unknown variable 'datadir=/mnt/System_Data' which I did not understand. So, I open another .cnf file and edited to be identical by changing name-X within the [name-X] to [MYSQL] and then editing a linewith datadir= /dir/dir/file-name to datadir=/mnt/System_Data The final product was: file = /etc/my.cnf with contents of [MYSQL] datadir=/mnt/System_Data Then I tested it and it worked. I would not bother people on this list with this but it is not the first time it has happened. That is I type a configuration file check it re check it and it refuse to function then copy and edit a file from some other location edit it to where it is exact and I do mean exact equal the the one I created from the keyboard and it function correctly. Does anyone have any explanation why creating a new file from keyboard refuses to work and editing and existing file and saving it works? Frank Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com