LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 12-29-2005, 09:49 PM   #1
snowyice
LQ Newbie
 
Registered: Dec 2005
Posts: 21

Rep: Reputation: 15
Question How to start mySQL automatically


I have just install mySQL on the root user (Fedora core4), But i have a problem on running mySQL on the other user account.

Anyone have any idea how this could be solve?

I am just thinking of making mySQL auto start, but i have a problem doing that too.. Anyone could help?

pls pls pls
 
Old 12-29-2005, 09:58 PM   #2
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
your system's root user is not the same as the mysql root user. users for mysql have no connection to users of your system.

the default password for the mysql root user is blank, nothing, nada.

If you want to start mysql, one ways is with the command below. run this command as root (your system root user - use su).

mysqld_safe &

If this doesn't work, your mysql installation is lacking other mysql packages. If it works, you should be able to access mysql with:

mysql -u root

There you can change to the mysql database and add users, passwords for the mysql root user and other mysql users.

http://dev.mysql.com/doc/

Pick the correct version and the format you want. Use it, because it will help you with examples, explainations, and howto's.

edit: you can use the mysqld_safe & command in your /etc/rc.d/rc.local file.

Last edited by megaspaz; 12-29-2005 at 11:48 PM.
 
Old 12-29-2005, 11:06 PM   #3
snowyice
LQ Newbie
 
Registered: Dec 2005
Posts: 21

Original Poster
Rep: Reputation: 15
Thank you!

This infor helps....
 
Old 12-29-2005, 11:11 PM   #4
snowyice
LQ Newbie
 
Registered: Dec 2005
Posts: 21

Original Poster
Rep: Reputation: 15
hmm.. sorry.. i just realised i have another problem.

Cause i don't want another account to knoe the root password. That the reason why i want to start mySQL server automatically.

Another knoe how to do this?
 
Old 12-29-2005, 11:27 PM   #5
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
FYI, I don't know about the newest versions of mysql, but mysql comes default with an anonymous user with the user name of nothing - there is no value for this user's name. I highly recommend getting rid of this user and to create a password for the mysql root user.

This is the method I prefer since mysql will have 3 entries per mysql user for different domains of access.

1st, run the mysql command (you can do this as your system's regular user):

Code:
[shell prompt] $ mysql -u root
2nd, choose the mysql database:

mysql> use mysql;

You can then run the mysql commands below to remove the anonymous user and to add a password for the mysql root user.

Removing the anonymous user:

Code:
mysql> DELETE FROM mysql.user
    -> WHERE User='';
mysql> FLUSH PRIVILEGES;
Setting the root password.

Code:
mysql> UPDATE user SET Password = PASSWORD('new_password_here')
    -> WHERE User = 'root';
mysql> FLUSH PRIVILEGES;
Now whenever you want to use mysql you will need to use the -p flag.

Code:
[shell prompt] $ mysql -u root -p
<enter mysql user, root's password>
 
Old 12-29-2005, 11:31 PM   #6
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
you don't need any password to run the mysql server. You only need passwords when you want to use mysql.

again, to start the mysql server, su into your system's root user account with su and then run the command:

mysqld_safe &

that will start the server.

None of your system's regular users will know your system's root user's password.

to access mysql, you can in your regular user account use:

[shell prompt] $ mysql -u root -p

then enter the mysql's root user's password (You need to set the mysql root user's password first though). This will be hidden in the shell. No one but you will know this password either.

Last edited by megaspaz; 12-29-2005 at 11:32 PM.
 
Old 12-29-2005, 11:37 PM   #7
snowyice
LQ Newbie
 
Registered: Dec 2005
Posts: 21

Original Poster
Rep: Reputation: 15
But the problem is that i will not have the access to the root account next week. (^_^"')

So i need to make sure the mySQL server auto start running once i reboot the system.

Thanks for your prompt reply.. =D
 
Old 12-29-2005, 11:38 PM   #8
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
Also, if you want to shutdown mysql use the command below as your system's root user (su):

Code:
[shell prompt] # mysqladmin -u root -p shutdown
enter your mysql root user's password.
 
Old 12-29-2005, 11:39 PM   #9
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
Quote:
Originally Posted by snowyice
But the problem is that i will not have the access to the root account next week. (^_^"')

So i need to make sure the mySQL server auto start running once i reboot the system.

Thanks for your prompt reply.. =D
if you don't have system root access, you won't be able to startup the mysql server on boot or manually.
 
Old 12-29-2005, 11:41 PM   #10
snowyice
LQ Newbie
 
Registered: Dec 2005
Posts: 21

Original Poster
Rep: Reputation: 15
oh.. hmm.. there is really no other way?

hmm.. like writting a startup scipt at rc3.d?? or others : (
 
Old 12-29-2005, 11:44 PM   #11
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
Quote:
Originally Posted by snowyice
oh.. hmm.. there is really no other way?

hmm.. like writting a startup scipt at rc3.d?? or others : (
so you do have system root access?
 
Old 12-29-2005, 11:45 PM   #12
snowyice
LQ Newbie
 
Registered: Dec 2005
Posts: 21

Original Poster
Rep: Reputation: 15
I have it now.. not next week... : (
 
Old 12-29-2005, 11:48 PM   #13
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
As long as you have system root access you can start the mysql server. I told you how to start it up and how to have it start up on reboot.

put this command in your /etc/rc.d/rc.local file:

mysqld_safe &
 
Old 12-30-2005, 12:08 AM   #14
snowyice
LQ Newbie
 
Registered: Dec 2005
Posts: 21

Original Poster
Rep: Reputation: 15
Thank you!! it works... I have been trying to solve this problem for days.. THANKS! =D
 
  


Reply



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 do I automatically start a program at start up? victordh Linux - General 7 10-27-2013 06:02 AM
How can mySQL start automatically on boot ? John_Emad Linux - Software 6 06-24-2005 12:33 PM
why my MySQL was automatically stopped baosheng Linux - Software 0 02-01-2005 05:36 PM
start mysql automatically compzoo Linux - Newbie 4 01-15-2005 10:47 AM
start apps automatically on start up? chunlee Linux - Newbie 3 09-04-2004 12:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:20 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
Open Source Consulting | Domain Registration