Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems setting MYSQL on linux redhat 6.0

Status
Not open for further replies.

MatthewP

Programmer
Jan 16, 2001
176
GB
Due to over-consumption of MySQL resources, my website just got removed and put on it's own Red Hat 6.0 Linux server. I've now got 10 days to sort it from no experience of Linux or sysadmin whatsoever.

I managed (by some miracle) to log in to telnet as root, set up the database, and set up permissions in the user and db databases. Then did flush priviliges.

I can only get into mysql through telnet though and only as root. I can't get in as another user at all, through telnet or Perl scripts. Any idea what I might have done wrong?

Thanks,
Matt.
 
If you can get SSH version 2 installed on the system and use that instead of telnet(insecure). Next, if you have root privileges on that box, just create a new account like so:

>adduser YourUserName
>passwd YourUserName
Enter password: ******

Once you've got that done, you shoud be able to log in as that user.


Hope this helps! Rninja

smlogo.gif

 
Hi,



Bit confused - do you mean you can't telnet as another user or that you can telnet as 'userx' but there are problems with mysql permissions ? As Rninja says, you would setup new linux (vs mysql) users with the command '/usr/sbin/useradd userx' or '/usr/sbin/adduser userx' which is actually using a symlink to the first. If you do 'cat /etc/passwd' that will show all existing users.



Regards







 
I can get into the linux server with other users, it's just mySQL that will only let me in as root, which is obviously no good for a web site. So I suppose this is a MySQL question really.

Currently I can do mysql -p mydatabase, and enter the password and get in OK - providing I've su'd to root in the shell beforehand. It doesn't work if I dont su to root first.

So confused as I'm new to all this...

thanks,
Matt.
 
Hi,

I'd guess there is some permissions problem with the mysql binaries, although if mysql was installed from a rpm that is normally handled by the rpm scripts changing permissions to allow read/exec by non-root users.

If you get a binary from mysql.com the install steps include :

# groupadd mysql
# useradd -g mysql mysql
# cd /usr/local
# tar zxvf /path/to/mysql-VERSION-OS.tar.gz
# ln -s mysql-VERSION-OS mysql
# cd mysql
# scripts/mysql_install_db
# chown -R root /usr/local/mysql
# chown -R mysql /usr/local/mysql/data
# chgrp -R mysql /usr/local/mysql
# chown -R root /usr/local/mysql/bin
# /usr/local/mysql/bin/safe_mysqld --user=mysql &

You will notice that you manually change ownership (chown) and change group ownership (chgrp) of parts of the distribution. In particular, you create a user 'mysql' and a similarly named group, then give that user permissions on the files and finally (last line) start the server under the userid 'mysql'.

So it looks like you need to check the equivalent permissions on your installation... Is that a redhat rpm version or direct from


Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top