Can't start mysql
Hi.
I am installing Mysql 4.0, apache 1.3, PHP 5.0 on fedora 1 all from source. Started with the Mysql installation, then apache and PHP.PHP and apache works fine but I can't start mysql. After the installation I started mysql and I got the error ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2). I don't have a /tmp/mysql.sock, I tried to touch a file but I still have the same fault (111 instead of 2). Even my phpinfo() says that /tmp/mysql.sock should exists. Does anyone have any idea? Greateful for any help. /Krilen |
What command did you use to start mysql?
--> /sbin/service mysqld start ? |
/tmp/mysql.sock exists only when MySQL is actually running. Are you sure it started correctly (the init script usually works well out of the box)? Can you see mysqld in your ps output?
Håkan |
I started the server with:
/usr/local/bin/mysql And I can't se anything running with ps that looks like mysql. /Krilen |
Start it with the command
--> /sbin/service mysqld start and it will create a socket for you and mysql will be running. If you start the daemon directly with --> /usr/local/bin/mysql it will directly start mysql without creating a socket and therefor fail. |
Get the error:
mysqld: unrecognized service /Krilen |
This seems to be SuSE only, but I start mysql here with "rcmysql start"... worth the shot I guess :=)
|
This really is SuSE only.
The counterpart of it in red hat is the command i mentioned above. But nevertheless, worth the shot :-) |
Sorry no help, error:
-bash: rcmysql: command not found I found another log, when I try to start this: /usr/local/bin/mysqld_safe & I get this outprint: Starting mysqld daemon with databases from /usr/local/var 040812 21:02:50 mysqld ended and the log /usr/local/var/thor.err (thor is the name of my machine) says: 040812 21:02:50 mysqld started InnoDB: unable to create ./innodb.status.2209: Permission denied 040812 21:02:50 Can't init databases 040812 21:02:50 Aborting 040812 21:02:50 InnoDB: Warning: shutting down a not properly started InnoDB: or created database! 040812 21:02:50 /usr/local/libexec/mysqld: Shutdown Complete 040812 21:02:50 mysqld ended Can this help? /Krilen |
Try executing the startup script for mysql. I think the following should be correct.
-->/etc/rc.d/init.d/mysqld start |
/etc/rc.d/init.d/mysqld: No such file or directory
|
oops, i think this isn't correct
--> /sbin/service mysqld start it should be --> /sbin/service mysql start or something similiar (depending on distro version...). When i make a suggestion, try it with a few deviations... |
Isn't /sbin/service xxxxxx start/stop etc for programs that is installed with packages for the specific distribution. In my case rpm packages because I use fedora.
If I run: /sbin/service --status-all I get all the program that was installed at the installation, cron, sendmail, sshd etc. And none of the program that I installed from source. /Krilen |
Quote:
|
Found the problem this morning, maybe I was to tiered (or stupied) last night.
I forgot to change /usr/local/var to mysql owner and group. /Krilen |
Quote:
how to change the /usr/local/var to mysql owner and group error return ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) i did read MySQL manual it says "Once you've installed MySQL (from either a binary or source distribution), you need to initialise the grant tables, start the server, and make sure that the server works okay." and when i execute mysql_install_db in my /usr/bin/ it returns error Didn't find /usr/libexec/mysqld You should do a 'make install' before executing this script well then i try to find my mysqld. i can't find it, the things is like [root@pan bin]# whereis mysqld mysqld: /usr/share/man/man1/mysqld.1.gz then i did [root@pan bin]# mysql_config Usage: /usr/bin/mysql_config [OPTIONS] Options: --cflags [-I'/usr/include'] --libs [-L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl -lm] --socket [/var/lib/mysql/mysql.sock] --port [3306] --version [3.23.58] i did mysqld_safe and safe_mysqld and mysqld and mysqladmin, all return error as "command not found" i fresh installed fedora core 1, choose mysql installed as defualt, anyone can help me on this. thank you very much |
Hi.
Since I did the installation from source and not from the default installation my anwser might not be correctly right for your situation but here I go. All of this is done by root: After the installation I ran this program: /usr/local/bin/mysql_install_db (to install the basic databases) Then I created the user mysql and group mysql. Then I should have changed the databases to be owned by mysql (user and group) but this is the part that I forgot and created my error. But when I ran in /usr/local: chown -R mysql.mysql var (my databases is located in var, /usr/local/var/) Then I could start mysql without problem: /usr/local/bin/mysqld_safe --user=mysql & And if I type mysql I get the mysql prompt. I hope this will help you. If you have any other question let me know. /Krilen |
ok i share my answer here, i went to /usr/local/bin/ this folder and run the mysql_db_install. so it returns error. then i cd to / then i run usr/local/bin/mysql_install_db , it started to install, and work perfectly.
then when i try to went mysqld in /usr/libexec/ it turns error something like " refer security section of the manual to know how to run mysql as root" and bla bla. again i am d@mn confused. i search around all kinds of forums, eventually i saw a line " u can not start mysql service when u login as root" then ok , fine su mysql , and run /usr/libexec/mysqld , BINGO~! IT WORKED AT LAST~!! SO HAPPY ~! i don;t know the exact gimmick behind, but i made it work, hope this help people who review this post later. thank u krilen as well. |
All times are GMT -5. The time now is 07:48 AM. |