LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-26-2016, 08:54 AM   #1
yendhe
LQ Newbie
 
Registered: Dec 2015
Posts: 6

Rep: Reputation: Disabled
Can't start mysql second instance.


Hi,

As i have done configuration of multiple instance of mysql server on single machine (Centos6).Firstly i have installed Mysql on my machine and then similary configure second instance but stuck with some issue.As i am unable to start a second instance of mysql server due to some error.
And i have also checked the ownership and permission of mysql2 directory i.e second mysql instance directory.

Here is my configuration file i.e my2.cnf

[mysqld]
datadir=/var/lib/mysql2
socket=/var/lib/mysql2/mysql2.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
port = 3307
[mysqld_safe]
log-error=/var/log/mysqld2.log
pid-file=/var/run/mysql2/mysqld2.pid

ERROR:
[abc@station ~]# mysqld_safe --defaults-file=/etc/my2.cnf
160326 19:20:04 mysqld_safe Logging to '/var/log/mysqld2.log'.
160326 19:20:04 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql2
160326 19:20:04 mysqld_safe mysqld from pid file /var/run/mysql2/mysqld2.pid ended

LOGS:

160326 19:04:08 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql2
InnoDB: Log scan progressed past the checkpoint lsn 0 37356
160326 19:04:08 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 0 44233
160326 19:04:08 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
160326 19:04:08 InnoDB: Started; log sequence number 0 44233
160326 19:04:08 [ERROR] /usr/libexec/mysqld: Can't create/write to file '/var/run/mysql2/mysqld2.pid' (Errcode: 2)
160326 19:04:08 [ERROR] Can't start server: can't create PID file: No such file or directory
160326 19:04:08 mysqld_safe mysqld from pid file /var/run/mysql2/mysqld2.pid ended



Thank you
 
Old 03-26-2016, 10:10 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by yendhe View Post
Hi,
As i have done configuration of multiple instance of mysql server on single machine (Centos6).Firstly i have installed Mysql on my machine and then similary configure second instance but stuck with some issue.As i am unable to start a second instance of mysql server due to some error. And i have also checked the ownership and permission of mysql2 directory i.e second mysql instance directory.
Read the "Question Guidelines" link in my posting signature. You need to provide details...saying "some issue" and "some error" tells us absolutely nothing...and you don't tell us what version of MySQL or CentOS...you mention 6, but not 6.xxxx???
Quote:
Here is my configuration file i.e my2.cnf
Please use CODE tags to make things easier to read.
Quote:
160326 19:04:08 [ERROR] /usr/libexec/mysqld: Can't create/write to file '/var/run/mysql2/mysqld2.pid' (Errcode: 2)
160326 19:04:08 [ERROR] Can't start server: can't create PID file: No such file or directory
160326 19:04:08 mysqld_safe mysqld from pid file /var/run/mysql2/mysqld2.pid ended
Does the directory structure exist? The file? What ARE the permissions on them? Owner? And are you trying to start things up as root?

The MySQL reference guide has instructions on how to run multiple instances:
http://dev.mysql.com/doc/refman/5.7/...e-servers.html
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to restrict many to many table to one instance of a record in MYSQL lmcilwain Programming 7 01-27-2015 02:58 AM
problem with MySQL instance shifter Linux - Server 1 08-23-2012 10:58 AM
how to stop mysql instance? mei0fei Linux - Software 2 08-04-2011 04:39 AM
Can't able to allocate the large pages in the mysql instance kamal_k17 Linux - Enterprise 0 07-09-2009 08:04 PM
K3B tries to start new instance of KDE (on top of the current one!) DaneM Linux - Software 0 02-09-2005 01:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration