Results 1 to 8 of 8
The MySQL database I'm having trouble with is hooked into an Apache site, which works fine, except for the part that accesses the database. I'm having trouble getting MySQL to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-24-2007 #1
MySQL service startup error
"service mysqld start"
and I get
"Warning: Asked for 196608 thread stack, but got 126976 Fatal Error: Please read 'Security' section of the manual to find out how to run mysqld as root
/etc/init.d/mysqld: Shutdown Complete"
Meanwhile, when I try connecting to the database through the site I get:
can't connect to MySQL database: Can't connect to local MySql server through socket '/var/lib/mysql/mysql.sock' (2)
Now, the really weird part is if I go back to the bash prompt and type in
"service mysqld start --user=mysql &"
Warning: Asked for 196608 thread stack, but got 126976
/etc/init.d/mysqld: ready for connections.
Version: 4.0.21-Standard socket: '/var/lib/mysql/mysql.sock' port: 3306 official MySQL-standard binary
and then the console freezes and I have to Ctrl+C out of it, but the database connection is now working.
Is there a way to get this working when the computer starts, so I don't have to type in "service mysqld start --user=mysql &" every time?
- 07-25-2007 #2
The init script you added is wrong. Edit it to run as the correct user. Also make sure you're using an init script written for the type of init system you have.
- 07-25-2007 #3
can't edit it
Opening mysqld in vi gives me a bunch of random characters, I think it is a binary. Are you talking about a different script? I tried creating a separate script called startsql that went like this:
service mysqld start --user=mysqld &
and then I put it in /etc/init.d/
however, when I restarted the computer, it never ran. Also, it didn't turn green like the other scripts that are in that folder. What is this init script you are talking about? Thanks for the speedy reply.
- 07-26-2007 #4
You've done something horribly wrong if anything under /etc/init.d is a binary. What distribution are you using? What steps did you take to install mysql?
- 07-26-2007 #5
I'm using Red Hat Enterprise 4 and someone else installed MySQL long before I ever got the chance to work on it. I moved the mysqld file into /etc/init.d/ but before that, typing "service mysqld start" would give me an error about not finding that service. After I moved it into the /etc/init.d/ folder, I was at least able to get the server running with the "service mysqld start --user=mysql &" command. Is it possible that maybe there should be a different file in /etc/init.d/ that links to mysqld and runs it as the user mysql? Thanks for your help so far.
- 07-27-2007 #6
mysqld, the actual mysql daemon, should be in like /usr/bin. Under /etc/init.d there should be a script that controls starting stopping and restarting mysqld. When you got "Service not found" you should have tried running
chkconfig add mysqld
- 07-27-2007 #7
Ok, I tried moving mysqld to /usr/bin/ and then running:
chkconfig --add mysqld
but that gave me the error:
Error reading information on service mysqld: No such file or directory
So, like you said, I should probably re-install it. Will re-installing mysql affect my databases, or will those be safe? Also, by what method would you recommend re-installing mysql? My yum updater seems to be broken so I might have to compile from source, or find a way to fix yum. Thank you for sharing your knowledge on mysql with me.
- 07-27-2007 #8
Backup your databases with mysqldump. It sounds like you've got more than one problem, you pretty mcuh never want to install things from source in RHEL. It defeats the whole purpose of RPM. You're looking at re installing methinks.