Solved

visudo for mysql services

Posted on 2011-09-16
2
503 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 77

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux  Script File Attributes 5 52
CheckListBox usage 3 50
How to learn Linux? 10 42
Hacked File Timestamps 4 49
As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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…
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.

911 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

22 Experts available now in Live!

Get 1:1 Help Now