Solved

visudo for mysql services

Posted on 2011-09-16
2
521 Views
Last Modified: 2012-05-12
HI
I know how to use visudo ... but dont understand how to add command to start multi_mysqld properly

example :

# User alias specification
User_Alias ADMINS = support
# Cmnd alias specification
Cmnd_Alias MYSQL = /etc/init.d/mysql
Cmnd_Alias MYSQLD = /usr/bin/mysqld_multi
Cmnd_Alias MYSQLD_SAFE = /usr/bin/mysqld_safe,/bin/open

# User privilege specification
root    ALL=(ALL) ALL
ADMINS ALL = NOPASSWD:MYSQL
ADMINS ALL = NOPASSWD:MYSQLD
ADMINS ALL = NOPASSWD:MYSQLD_SAFE

now problem is :

shutting down is fine

example

myqld_multi stop   : works fine..

but mysqld_multi start    : it will about to start then will fail

now i have added mysqld_safe command as you can see.. but still it will not allow to start the database as it does not h ave the proper access right.


but "mysqld_multi stop" works fine ..

if any body done it before .. please advise me ..


note : as root user mysqld_multi start works perfect .


thanks

Sep 16 10:51:54 mfdb mysqld_safe: Starting mysqld daemon with databases from /db/data1
Sep 16 10:51:54 mfdb mysqld_safe: Starting mysqld daemon with databases from /db/data2
Sep 16 10:51:54 mfdb mysqld_safe: Starting mysqld daemon with databases from /db/data3
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54 [Warning] Can't create test file /db/data1/mfdb.lower-test
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54 [Warning] Can't create test file /db/data1/mfdb.lower-test
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54 [Warning] One can only use the --user switch if running as root
Sep 16 10:51:54 mfdb mysqld:
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54 [Warning] Can't create test file /db/data2/mfdb.lower-test
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54 [Warning] Can't create test file /db/data2/mfdb.lower-test
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54 [Warning] One can only use the --user switch if running as root
Sep 16 10:51:54 mfdb mysqld:
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54 [Note] Plugin 'FEDERATED' is disabled.
Sep 16 10:51:54 mfdb mysqld: #007/usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54 [Note] Plugin 'FEDERATED' is disabled.
Sep 16 10:51:54 mfdb mysqld: #007/usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54 [Warning] Can't create test file /db/data3/mfdb.lower-test
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54 [Warning] Can't create test file /db/data3/mfdb.lower-test
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54 [Warning] One can only use the --user switch if running as root
Sep 16 10:51:54 mfdb mysqld:
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54 [Note] Plugin 'FEDERATED' is disabled.
Sep 16 10:51:54 mfdb mysqld: #007/usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54  InnoDB: Operating system error number 13 in a file operation.
Sep 16 10:51:54 mfdb mysqld: InnoDB: The error means mysqld does not have the access rights to
Sep 16 10:51:54 mfdb mysqld: InnoDB: the directory.
Sep 16 10:51:54 mfdb mysqld: InnoDB: File name ./ibdata1
Sep 16 10:51:54 mfdb mysqld: InnoDB: File operation call: 'open'.
Sep 16 10:51:54 mfdb mysqld: InnoDB: Cannot continue operation.
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54  InnoDB: Operating system error number 13 in a file operation.
Sep 16 10:51:54 mfdb mysqld: InnoDB: The error means mysqld does not have the access rights to
Sep 16 10:51:54 mfdb mysqld: InnoDB: the directory.
Sep 16 10:51:54 mfdb mysqld: InnoDB: File name ./ibdata1
Sep 16 10:51:54 mfdb mysqld: InnoDB: File operation call: 'open'.
Sep 16 10:51:54 mfdb mysqld: InnoDB: Cannot continue operation.
Sep 16 10:51:54 mfdb mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld2.pid ended
Sep 16 10:51:54 mfdb mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld1.pid ended
Sep 16 10:51:54 mfdb mysqld: 110916 10:51:54  InnoDB: Operating system error number 13 in a file operation.
Sep 16 10:51:54 mfdb mysqld: InnoDB: The error means mysqld does not have the access rights to
Sep 16 10:51:54 mfdb mysqld: InnoDB: the directory.
Sep 16 10:51:54 mfdb mysqld: InnoDB: File name ./ibdata1
Sep 16 10:51:54 mfdb mysqld: InnoDB: File operation call: 'open'.
Sep 16 10:51:54 mfdb mysqld: InnoDB: Cannot continue operation.
Sep 16 10:51:54 mfdb mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld3.pid ended

Open in new window

0
Comment
Question by:fosiul01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 78

Accepted Solution

by:
arnold earned 500 total points
ID: 36548503
Does the behavior change is you use full path
sudo /usr/bin/mysqld_multi start


The error response you posted deals with permissions on some directories.

The three errors as you to run mysql_upgrade on the databases.
0
 
LVL 29

Author Comment

by:fosiul01
ID: 36548606
thanks

my fault
i was not typing sudo infront of the command

works perfectly
 sudo /usr/bin/mysqld_multi start

thanks for point me out ..
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question