LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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

Reply
 
Search this Thread
Old 08-25-2002, 01:38 AM   #1
X11
Member
 
Registered: Dec 2001
Location: Brisie, Australia
Distribution: Slackware 8.1
Posts: 324

Rep: Reputation: 30
How-to get MySQL setup properly


I'm having a problem with setting MySQL properly with a user to administrate MySQL:

I have compiled MySQL on Slackware Linux 8.1 on a laptop I have up and running right next to me.

Here's the steps, that I went through to get MySQL compiled and installed on the laptop:

1. Downloaded the MySQL source package from the MySQL website www.mysql.com to
/tmp/Programs/Networking_Tools/MySQL/
2. Created a group called mysql: groupadd mysql
3. Created a user called mysql: useradd mysql mysql
4. Untarred and Ungzipped: tar zxvf mysql-3.23.51.tar.gz
5. Change to the mysql-3.23.51 directory: cd mysql-3.23.51

6. Set the options for the configure script: ./configure --prefix=/usr/local/mysql
7. Started Compiling MySQL: make
8. Installed MySQL: make install

9. Changed to scripts directory and typed./mysql_install_db
10. Changed to the directory called support-files: cd ../support-files
11. Copied the file named my-medium.cnf to /etc directory as mysql.cnf: cp my-medium.cnf /etc/mysql.cnf

12. Changed the ownership (and all the subdirectories) /usr/local/mysql
to root: chown -R root /usr/local/mysql
13. Changed the ownership of /usr/local/mysql/var (and all the subdirectories)
to mysql: chown -R mysql /usr/local/mysql/var
14. Changed the group ownership of /usr/local/mysql to mysql:
chgrp -R mysql /usr/local/mysql

15. Changed to /usr/local/mysql/bin cd /usr/local/mysql/bin
16. Typed: ./safe_mysqld --user=mysql & (I pretty sure this is run the mysqld daemon)
Message Output from ./safe_mysqld --user=mysql & on bash console/ternimal:
Code:
Starting mysqld daemon with databases from /usr/local/mysql/var
17. Changed to another console (Alt-F2) and logged in as the root user.
18. Changed to the root (/) directorycd /
19. Made a symlink to /usr/local/mysql/bin to make it easier for myself : ln -s /usr/local/mysql/bin MYSQL
20. Then I tried the following to create a database:
./mysqladmin --user=mysql -p CREATE test2
and then typed in the password when it asked me to.

Error Output:
Code:
./mysqladmin: connect to server at 'localhost' failed 
error: 'Access denied for user: 'mysql@localhost' (Using password: YES)'
Sorry it's SO long, THANKS a LOT a in advance.
 
Old 08-25-2002, 04:43 AM   #2
ShawnD
Member
 
Registered: Jul 2002
Distribution: Mandrake 8.2
Posts: 127

Rep: Reputation: 15
that is really strange, i have the opposite problem and it scares the hell out of me. i was root and i did the ./safe_mysqld --user=mysql and it said it started. i then exitted as root and logged in as shawnd and did the command ./mysqladmin --user=mysql and it gave me a list of commands, ok that's nice. i tried it AGAIN with ./mysqladmin --user=root and it gave me a list of commands....joking it did ./mysqladmin --user=ass and it STILL gave me a list of commands

i was able to log in as 'ass' with no password, now THAT is scary
 
Old 08-25-2002, 05:52 AM   #3
X11
Member
 
Registered: Dec 2001
Location: Brisie, Australia
Distribution: Slackware 8.1
Posts: 324

Original Poster
Rep: Reputation: 30
I've tried what you have done and I also come with same thing, when I type in the following: ./mysqladmin --user=someone

I guess ./mysqladmin --user= "spits out" the help screen for any user.
 
Old 08-25-2002, 06:17 AM   #4
ShawnD
Member
 
Registered: Jul 2002
Distribution: Mandrake 8.2
Posts: 127

Rep: Reputation: 15
mine does more than that

./mysqladmin --user=ass create ass

i went to file manager as root to check mysql/var to see if it really created ass, it did
 
Old 08-26-2002, 04:58 PM   #5
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,421

Rep: Reputation: 100Reputation: 100
i log in like
'mysql -u myself -p'
then i have to enter my password and go working. that's all. try that and post if it fails.
cheers, jens
 
Old 08-27-2002, 01:23 AM   #6
X11
Member
 
Registered: Dec 2001
Location: Brisie, Australia
Distribution: Slackware 8.1
Posts: 324

Original Poster
Rep: Reputation: 30
The following is what I do when starting up MySQL.

I have started the mysql daemon on one virtual terminal.
Code:
./mysql --user=mysql &
While on another virtual terminal I run the commands to administer MySQL. I've tried you suggested on this terminal; It works but, NOT securely. Eg. I can type in
Code:
./mysql --user=<username> -p
NOTE: where <username> is, I can type anyname in there!

Also the -p option does ask for a password, but it lets me in even with out typing in a password.

Last edited by X11; 08-27-2002 at 01:45 AM.
 
Old 08-27-2002, 05:46 AM   #7
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,421

Rep: Reputation: 100Reputation: 100
mysql registers users and their passwords and rights in a table 'mysql'. i donīt know what happens when u invoke the deamon the way u do it but it seems that it corrupts the security check. did u try to start the deamon the way i recommended? itīs working smoothly on my box.
'/usr/bin/safe_mysqld'
'mysql -u myself -p'
to shutdown:
'mysqladmin -u root -p shutdown'
cheers, jens
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to setup rsh or configure ssh properly cheeku Linux - Software 5 03-30-2006 07:47 AM
MySQL setup. sikofitt Programming 1 09-29-2005 04:43 AM
System won't boot properly knoppix doesn't initialize properly rodewan Linux - Software 0 01-23-2005 03:35 PM
MySQL setup stops at command "./configure --prefix=/usr/local/mysql" k41184 Linux - Software 1 05-20-2004 02:44 PM
How to start properly MySQL in SuSE 8.1? wvelasquez Linux - Software 1 01-07-2003 05:34 PM


All times are GMT -5. The time now is 07:17 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration