Starting mysql using login script
Hi,
Can sombody plz guide me how to start mysql using a login script. I dont want to type pasword. Zulfi. |
can you please elaborate
what operating system your using , the version of mysql etc ... what do u mean by login script ? what are you trying to achieve? |
Hi,
Thanks for your response. I am using Fedora 1o. I want to start sqld and some people on this forum helped me for this. However I have to use : Code:
su i)how to write the script for executing the above commands without providing the passwd. The script should be able to execute at the time of guest user's login. ii) in which file i have to store the script. Zulfi. |
Is there a specific reason why you don't want the mysql daemon to be started at startup?
Quote:
Quote:
A last note: your title states mysql (the mysql client), your thread is about mysqld (the mysql daemon). There is a difference between the two ;) |
Thanks for the correction of the title.
Quote:
I want to start mysqld at startup or at guest login and this is what i am looking for. I dont know about sudo but how can i use it in a login script? Zulfi. |
Quote:
Quote:
Code:
sudo mysqld Maybe more knowledgeable people can give the finer details. |
see http://www.mjmwired.net/resources/mj...es.html#enable
It explain how to set up services in fedora. There is some graphical utilities where you can enable or disable services by clicking the checkboxes. or you can allow some users with permission to run specified commands as root by sudo, all you need is to edit /etc/sudoers file using visudo. eg:- [user] ALL=(ALL) NOPASSWD: [command] replace [user] and [command] with appropriate values. then you can execute: sudo [command] without any password if logged in as [user]. Also check. man sudo man sudoers |
Thanks _dkode_ and Wim Sturkenboom. I would try on your advice.
Zulfi. |
Hi,
I tried to change the following line in sudoers file: Code:
# %wheel ALL=(ALL) NOPASSWD:ALL Code:
Code:
>>> sudoers file: syntax error, line 84 <<< Zulfi. |
use the full path(absolute path) for the command.
if you don't know the path, use 'whereis' to find it. Assuming you need to run sqld as root. #whereis sqld this will give you the path, lets say /usr/sbin/sqld then you can change your sudoers entry to: Quote:
|
Hi,
Thanks for your response. I tried : Code:
## Same thing without a password Code:
[guest@HP-UX646UU ~]$ sudo service mysqld start Code:
Zulfi. |
I'm a bit of a noob, so I may be wrong, but I didn't think gz was a type of executable file? Google seems to confirm this.
Also, it would appear that you may have changed your sudoers file to make the sudo command log in as guest, not as root. |
@Shammyhealz: Look at the location the the gz-file; it's just the man page for mysqld
|
You are using: sudo service mysqld start
you need to add the command /sbin/service mysql start, in sudoers. not mysqld *edited Quote:
Code:
sudo mysqld Code:
sudo service mysqld start Code:
guest ALL=(ALL) NOPASSWD: /sbin/service mysqld start Code:
guest ALL=(ALL) NOPASSWD: ALL |
Quote:
|
I agree. Mysqld is a daemon and should be running in the background.
What distro do you use? Use ckconfig to enable services for the proper run levels for RPM distros like Redhat. You may also have a GUI config program where yiu can do it as well. Undo what you did for the guest user. Giving "guest" root rights without a password sound like a horror story sys admins tell be the campfire. Also download the manual for mysql. It lists tasks you need to perform after installation, such as giving the mysql root user a password, and dropping the demo tables. |
try it
#sudo mysqld edit the file inside as % guest ALL=(ALL) NOPASSWD: (ALL) then restart the mysqld. sudo /etc/init.d/mysqld restart no need to stop and start the mysqld just restart it. |
Hi,
Thanks for your guidance. I would check it on Monday. Zulfi. |
Hi,
I am still trying. Zulfi. |
Hi,
Thanks all of you who helped me with this problem. Its working. I tried on several computers but not on all. However, on RedHAt based computers i am getting some problem with service command. I have to check this again and let you people know if there is any problem. Otherwise I would declare this thread as solved. Zulfi. |
Code:
chkconfig --levels 35 mysql Code:
chkconfig mysql 35 Please stop trying to give "guest" users root access with sudo. The idea is inane and very dangerous. |
All times are GMT -5. The time now is 06:09 PM. |