LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 02-14-2004, 08:13 PM   #1
dilberim82
Member
 
Registered: Apr 2001
Location: NY
Distribution: used to be Redhat, now Debian Sarge
Posts: 291

Rep: Reputation: 30
mysql


mysql is confusing as hell... when i run /usr/sbin/mysqld it says "do you have mysqld server running on port: xxxxxx" and then aborts. so i think that means its already running but i dont see it when i do a ps. anyways, if it is already running how do i change the password for root. I installed using rpm and where is the default directory?
 
Old 02-14-2004, 08:25 PM   #2
ter_roshak
Member
 
Registered: May 2001
Location: Everett, WA
Distribution: Gentoo, RedHat
Posts: 102

Rep: Reputation: 15
You can find out if it is starting when your machine boots by, (as root), typing ntsysv at your console, then scrolling down to mysqld. If it is not selected, you can select it to start it every time your machine boots.

A good way to see if mysql is running on Red Hat is to type 'service --status-all | grep mysql' to find it. You can start and stop the service by 'service stop mysqld' or 'service start mysqld'.

Here is a link that will tell you all about setting up your password on mysql, and a couple of ways of doing it:

http://www.mysql.com/doc/en/Default_privileges.html

-Josh
 
Old 02-14-2004, 08:27 PM   #3
moonloader
Member
 
Registered: Nov 2003
Location: linuxquestions.org
Distribution: Linux and BSD
Posts: 229

Rep: Reputation: 30
Stop and restart mysql:

/etc/init.d/mysql stop
/etc/init.d/mysql start

Limit root and non-essential access. Change the default (empty) root password. Delete any non-localhost 'root' users, and any 'blank' users.

mysqladmin -u root password new_password

mysql -u root --password=new_password
mysql> use mysql;
mysql> delete from user where host = '%';
mysql> delete from user where user = '';
mysql> delete from db where user = '';
mysql> select user, host from user;
If you see any 'root' users other than root@localhost, delete them -- e.g.

mysql> delete from user where user = 'root' and host='myhost.com'
Flush the privileges, and you're done.

mysql> flush privileges;
mysql> quit
 
Old 02-14-2004, 08:35 PM   #4
dilberim82
Member
 
Registered: Apr 2001
Location: NY
Distribution: used to be Redhat, now Debian Sarge
Posts: 291

Original Poster
Rep: Reputation: 30
Mysql is selected, but in "ntsysv" but everytime i issue the command "mysql -u root mysql" it comes back w/ "mysql: unrecongized command". I used that link to set up mysql but its so confusing. I was lost after 2nd chapter.
 
Old 02-14-2004, 08:41 PM   #5
ter_roshak
Member
 
Registered: May 2001
Location: Everett, WA
Distribution: Gentoo, RedHat
Posts: 102

Rep: Reputation: 15
Ok, if you know its started, type 'mysql -u root' to login, (if you have not set your password). You will then be able to set your password and security stuff up. There is a post in this thread already that would be helpful there.

-Josh
 
Old 02-14-2004, 08:42 PM   #6
ter_roshak
Member
 
Registered: May 2001
Location: Everett, WA
Distribution: Gentoo, RedHat
Posts: 102

Rep: Reputation: 15
Once you have set your root password, you would login with the following string: 'mysql -u root -p' and you would then be prompted for your password.

-Josh
 
Old 02-14-2004, 08:53 PM   #7
dilberim82
Member
 
Registered: Apr 2001
Location: NY
Distribution: used to be Redhat, now Debian Sarge
Posts: 291

Original Poster
Rep: Reputation: 30
first, thanks for the quick replies
but thats what my problem is...it seems like its running but when i issue the command "mysql -u root" it says "command not found" i found a lot of help online and i am going through each one to see which one makes sense the most.
 
Old 02-14-2004, 09:04 PM   #8
ter_roshak
Member
 
Registered: May 2001
Location: Everett, WA
Distribution: Gentoo, RedHat
Posts: 102

Rep: Reputation: 15
I would do a search to find the path to where it was installed...since you installed using an rpm. I would recommend running updatedb as root, then slocate mysql. Once that is done, you may have the path you need to login to mysql, and you can add that to your system or user environment variable $PATH.

-Josh
 
Old 02-14-2004, 09:34 PM   #9
dilberim82
Member
 
Registered: Apr 2001
Location: NY
Distribution: used to be Redhat, now Debian Sarge
Posts: 291

Original Poster
Rep: Reputation: 30
ent

there are entries for mysql in /var/lib/mysql, /usr/sbin/mysqld and /usr/share/mysql. Is this normal? and when i do "printenv $PATH", this command doesn't return anything. I put those directories in my .bash_profile under $PATH, but it still doesn't work

Last edited by dilberim82; 02-14-2004 at 09:35 PM.
 
Old 02-14-2004, 10:27 PM   #10
ter_roshak
Member
 
Registered: May 2001
Location: Everett, WA
Distribution: Gentoo, RedHat
Posts: 102

Rep: Reputation: 15
To see your path, type 'echo $PATH'. If you update your path, you have to logout and login to have it take effect, or you can export your path.

Those entries for the locations of mysql do not seem normal, I would expect that you would have a /usr/bin/mysql so that all users can use it. /var/lib/mysql/ is the directory where your databases are stored... /usr/share/mysql/ is a directory with some character set and language stuff. I would try to type /usr/sbin/mysql or /sbin/mysql and see what that does for you. If it is the correct command, you should see an error saying that Access is denied.

Where did you get the rpms that you installed from? Can you post the hyperlink? I would like to take a look.

-Josh
 
Old 02-15-2004, 12:09 AM   #11
dilberim82
Member
 
Registered: Apr 2001
Location: NY
Distribution: used to be Redhat, now Debian Sarge
Posts: 291

Original Poster
Rep: Reputation: 30
i downloaded from here

I went ahead and downloaded the binary version and did it over again and i just put in /usr/local/mysql/bin. It works now, but i still cannot access it through apache, but i think i'll figure it out. Thanks a lot Josh. I'll ask you more questions if i have any.
 
  


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
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 07:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
Problems with MySQL on SuSE: Can't Connect (/var/lib/mysql/mysql.sock) neocookie Linux - Software 8 02-07-2008 11:48 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM


All times are GMT -5. The time now is 07:25 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration