LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   MySQL configuration (https://www.linuxquestions.org/questions/linux-general-1/mysql-configuration-3705/)

oulevon 06-25-2001 07:52 PM

MySQL configuration
 
I'm having a little trouble setting up MySQL database on my computer running Redhat 7.0. I downloaded the rpm file for the server and the client, and installed them successfully. The guide that came along with it doesn't really give any instructions for th rpm installation and configuration. The rpm installs successfully, and I can use the database manually from the shell, but I haven't set up the config files(I don't know what or where they are), so when I try to connect through java, it says can't connect because server's configuration denies access to data source. I'm guessing this is the default configuration. If anyone knows how to configure the server, please give me some ideas.

Thanks.

mcleodnine 06-26-2001 12:15 AM

Re: MySQL configuration
 
Quote:

Originally posted by oulevon
I'm having a little trouble setting up MySQL database on my computer running Redhat 7.0. I downloaded the rpm file for the server and the client, and installed them successfully. The guide that came along with it doesn't really give any instructions for th rpm installation and configuration. The rpm installs successfully, and I can use the database manually from the shell, but I haven't set up the config files(I don't know what or where they are), so when I try to connect through java, it says can't connect because server's configuration denies access to data source. I'm guessing this is the default configuration. If anyone knows how to configure the server, please give me some ideas.

Thanks.

Who are you trying to connect as?

jharris 06-26-2001 03:02 AM

I follow mcleodnine's path - have you added any users to the database? By default you will only have root@localhost hence any attempt to connect to it as another user, even root@hostname where hostname is the machine with the database on will fail... Have a look at the section in the manual about adding users. As for the config files, I dunno about the RPM but when I did a source install it didn't create the config files, you just create them in /etc/my.cnf if you need to set anything.

HTH

Jamie...

oulevon 06-26-2001 08:10 AM

I was trying to follow the guide. I screwed up something. Now if I type mysql at the prompt (this worked fine yesterday) I get the following error:
Error 1045: Access denied for user: 'root@localhost' (Using password: NO)

I've been trying to find in the manual how to delete this but no such luck. I can't get back into mysql to change anything. It won't let me access it.

jrmann1999 06-26-2001 03:05 PM

If you set a password and remember it hope is not lost, elsewise you'll just have to remove/reinstall mysql.

If you remember the pword just login with the -p option and it'll prompt you for a password.

J

oulevon 06-26-2001 03:27 PM

How do I go about removing it or reinstalling it? I don't want to screw this up again.

jharris 06-26-2001 04:10 PM

Have you thought about removing the files that hold the databases (on my system in /usr/local/var but may be something like /usr/local/mysql/var on yours or maybe /var/lib/myslq/??? (rpm I think)) using the old rm -rf * monster (be careful!!) then creating the initial databases again by running mysql_install_db

HTH

Jamie...

oulevon 06-26-2001 04:22 PM

That definitely crossed my mind. Very tempting. I was just worried I might delete something I shouldn't. That might be my only alternative though. On my system they're in /var/lib/mysql/mysql
Should I delete it all? There are about 15 files in there.
Thanks for your help

jharris 06-26-2001 04:24 PM

If it doesn't work at the moment, and you're going to remove it all then reinstall anyway - what have you got to lose?? You should have the following:
Code:

columns_priv.MYD  db.MYD  func.MYD  host.MYD  tables_priv.MYD  user.MYD
columns_priv.MYI  db.MYI  func.MYI  host.MYI  tables_priv.MYI  user.MYI
columns_priv.frm  db.frm  func.frm  host.frm  tables_priv.frm  user.frm

Yeah? Or something around that mark.

Jamie...

oulevon 06-26-2001 04:30 PM

Okay, I did it. I then logged out and then came back to give it a try. Access still denied. So in /var/lib/mysql I deleted a .sock file which really screwed everything up since now I get a connection error, and can't even get it started. I think it's time to start over. Is there a trick to removing the files, or do I have to do it all manually?

Thanks again for your prompt help.

jharris 06-26-2001 04:35 PM

You will want to use rpm to remove the package otherwise I think you'll screw its database of install packages... I'm not of the Redhat camp so the best I can offer is RTFM - man rpm ;)

Jamie...

oulevon 06-26-2001 04:38 PM

Thanks again for all your help. I'll remove it and then give it another go tonight. I'll let you know how I make out. By the way, do you think MySQL is the best database to use ( in terms of ease)? I will only be using it along with java(jdbc) for some basic programs, nothing too big? Thanks again for your help.

jharris 06-26-2001 04:45 PM

I've used it a reasonable about with PHP and really like it but never with jdbc although I've got a friend who is a serious Java hacker (I keep trying to get him to take medication for this) and he loves it so I imagine it must be good. I can't honestly say that I've tried the other GPLd/free dbs out there though.

If you're thinking of getting a book on MySQL I advise you to steer clear of O'Reilly's offering... I've got a shelf full of O'Reilly books and they all amazing, apart from this one, which makes it a real let down.

Jamie...

oulevon 06-26-2001 05:57 PM

I have a book on Java programming on linux, and it strongly recommended MySQL. Thanks for your advice on the book. That's too bad. O'Reilly usually puts out very good books. Thanks again for all your help. I'm about to retackle the installation.

oulevon 06-26-2001 11:55 PM

Well, I'm up and running now. jharris thanks for all your help. I even have my program running now using the database. I'm going to have to look into learning a bit of sql though. Thanks for your help again.


All times are GMT -5. The time now is 04:44 AM.