Solved

visudo for mysql services

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Install Predefined Certificate on Ubunto 4 39
AWS ELB 5 79
ftp to port 21 4 43
CENTOS DHCP Server / PXE/TFTP 14 80
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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…
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…

809 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