Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
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.
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.
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.
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.
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.
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
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
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?
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
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.