service mysql start - doesn't work

C

cPanelBilly

Guest
Thank you ...

But here is the issue, when I tried to edit /etc/my.cnf and then save changes it says permissions denied!

I tried chmod 644 /etc/my.cnf doesn't work!

chown is root:root

Any Advice?
Are you root? If so do a lsattr /etc/my.cnf and paste the output here
 

khaled

Member
Sep 30, 2002
13
0
151
Yes I am ..

my.cnf was set immutable, and therefore not able to be written:

[[email protected] etc]# lsattr | grep my
------------- ./my.cnf~
------------- ./my.cnf.bkup
----i-------- ./my.cnf
[[email protected] etc]# chattr -i my.cnf

Once I removed the bit, I edited the file to remove the basedir directive.

[[email protected] etc]# /etc/init.d/mysql start
Starting MySQL [ OK ]
[[email protected] etc]# ps -eaf | grep my
root 9109 1 0 21:45 pts/0 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/cat.icescreen.net.pid
mysql 9148 9109 0 21:45 pts/0 00:00:00 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/cat.icescreen.net.pid --skip-external-loSales --socket=/var/lib/mysql/mysql.sock
root 9163 8531 0 21:45 pts/0 00:00:00 grep my


[[email protected] ~]# lsattr /etc/my.cnf
------------- /etc/my.cnf
[[email protected] ~]#


But still I see mysql failed to start, and sites with mysql and php and not working .. saying

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'user_cip'@'localhost' (using password: YES) in /home/user/public_html/inc/config.php on line 2

Regards,
Khaled
 

bin_asc

Well-Known Member
Jul 18, 2005
280
0
166
I see mysql did start. Your script just can`t connect to the mysql. Probably the passwords aren`t ok or the user isn`t created or the details for connection are wrong.
 

khaled

Member
Sep 30, 2002
13
0
151
OK .. fixed ....

Users weren't created from previous restoration ... I had to delete the account and restore it again, while mysql is up and running to take and create the db's again ...

Its working fine now :)

thanks for all the help

Regards,
K
 

shortfork

Well-Known Member
Sep 4, 2006
65
0
156
Major SQL issues Satisfied cPanel customer? Hopefully, I'll be one too!

Another satisfied cPanel customer :)
I did a migration from an ensim box last night (Ensim Pro 4.0.2-7.rhel) seemed to go well but on the server I migrated from, a couple tables were messed in the process (odd) for instance new posts to a vbulletin board were listed as topics but not in the message board.. This is fixed (on old server) and probably irrelvenat to problme on new cPanel box.. I only mention it because it may help..

Problem on new box..

db's migrated over are not listed on sites they are associated with, in fact, the only place they *do* show up is in the WHM section "Repair a Database" where they are listed...

"Change a User or Database Password" in the WHM shows no users.. if I add a new database on any site, it seems to happen but db is not listed..

if I try to restart from command (su - to root)

[email protected] [~]# service mysqld stop
mysqld: unrecognized service

[email protected] [~]# /etc/init.d/mysql start
Starting MySQLCouldn't find MySQL manager or server [FAILED]

If I try to restart from WHM

/usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists! mysql has failed, please contact the sysadmin (result was "Warning, no valid mysql.sock file found.mysql has failed").

Changing main sql password from WHM and I get

Reset MySQL Root Password
MySQL password change failed!!
A forced reset will now be attempted.

Main >> Reset MySQL Password

Reset MySQL Password

Waiting for mysql to restart.....Done
Fixing MySQL Privilege Table....Done
Changing Password....Done
Fixing MySQL Privilege Table....Done
Reloading MySQL ...
Done
Waiting for mysql to terminate.....
Restarting MySQL ....Starting MySQLCouldn't find MySQL manager or server[FAILED] Done
The MySQL root password has been changed.
Password changed for root to

If I try to get phpmyadmin in WHM I get a popup page with red banner with text:

#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)


So somehow... seems we're not connecting to the socket??

Any help would be greatly appreciated. I truly want to love this CP.. I really liked Ensim with the exception that it was so darn hard to update that I finally had to leave it or nut update it..

HELP PLEASE!!!!!!!!!!!!!!!!!!
 

shortfork

Well-Known Member
Sep 4, 2006
65
0
156
Check the configurations, or have your admin do so.
The most common cause of this is upgrading from MySQL4 to MySQL5 and configurations not working from the upgrade.
I did update to 5... to be honest, can't remember if I had the issues and that is why I upgraded or if I just upgraded because I was trying to upgrade the box before starting migration...

(long two days)

Where do I check configuration (I am the admin... albeit,a somewhat inept one)

and what do I look for?

Thanks in advance!

Wayne
 

mctDarren

Well-Known Member
Jan 6, 2004
662
6
168
New Jersey
cPanel Access Level
Root Administrator
Short: try removing the socket from the tmp directory and restarting. Mysql should recreate the socket if it's not there. Your config should be in my.cnf - most likely in /etc. Enter locate my.cnf to see where yours is located.
 

shortfork

Well-Known Member
Sep 4, 2006
65
0
156
Issue Solved

Short: try removing the socket from the tmp directory and restarting. Mysql should recreate the socket if it's not there. Your config should be in my.cnf - most likely in /etc. Enter locate my.cnf to see where yours is located.
I really do try to revisit threads when I solve a problem, for the good of all those who have similar issues... and I *thought* I saved the thread where I found what fixed this.. I believe it was in my.cnf ... I had to remove the path to mysql.sock ... that fixed it...

Now, if I can JUST figure out what to heck cPanel does with databases!!!

If I create a test database in a web account, in order to attempt to try to find just where to heck cPanel puts them, my gosh, i find reference to the new db in just about every site folder in /home/virtfs/

There are some things I like about cPanel VERY much... there are others that I'm quickly learning to HATE...

Site migration works pretty well... database migration absoutely, positively SUCKS!

I'm seeing that I need to manually bu and move the db's from the old ensim box, the question becomes, exactly *where* to put them once I get them over!

A quick and extremely dirty non-fix that I found was to simply rename the moved/renamed db back to what it was on the ensim box.. add same name user with same password and bingo, site works... however, in the site's control panel, the DB does NOT show up and that user has access to ALL the other databases that were imported..

God what a mess!

need icon for PULLING HAIR!

:mad:
 

mctDarren

Well-Known Member
Jan 6, 2004
662
6
168
New Jersey
cPanel Access Level
Root Administrator
however, in the site's control panel, the DB does NOT show up and that user has access to ALL the other databases that were imported..
That, sadly, is and has been the case for a long while I suppose. The best course of action the last time I moved a set of accounts from Ensim to CP was to export the DB, then manually create and import it into the newly created account. It aint pretty or fun, but it was the only way I got it to work. Guess the migration tool is still a bit off...
 

leorevenda

Active Member
PartnerNOC
Jan 24, 2004
30
0
156
I update this only to input my solution for problems on mysql, when new server for example:

mv /etc/my.cnf /etc/my.old.cnf
/scripts/mysqlup --force