LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How-to get MySQL setup properly (https://www.linuxquestions.org/questions/linux-software-2/how-to-get-mysql-setup-properly-28731/)

X11 08-25-2002 01:38 AM

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.

ShawnD 08-25-2002 04:43 AM

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 :(

X11 08-25-2002 05:52 AM

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.

ShawnD 08-25-2002 06:17 AM

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 :(

j-ray 08-26-2002 04:58 PM

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

X11 08-27-2002 01:23 AM

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.

j-ray 08-27-2002 05:46 AM

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


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