Solved

visudo for mysql services

Posted on 2011-09-16
2
499 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
2 Comments
 
LVL 76

Accepted Solution

by:
arnold earned 500 total points
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now