LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-24-2004, 01:03 AM   #1
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
Thumbs down Lost with MySql, PHP and Apache here


Hi guys, I need some help. I'm not even sure if this is the right forum. I'm following some tutorials about using php and mysql (I've done all basics from www.php.net yesterday) and now I'm trying to get mysql running. I'm using the default packages from Slackware 9.0 (apache, mysql, php). Apache and PHP works fine, but I cannot figure how to work/start mysql (in fact, all I know is that it's a database... nothing more, nothing less). So far, searching google and this forum, I've tried:

bash-2.05b# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)

bash-2.05b# mysqladmin -u root create mydb
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)'
Check that mysqld is running and that the socket: '/var/run/mysql/mysql.sock' exists!

At /usr/share/mysql I've tried

updatedb

It takes a while and then brings me back to the prompt. I also tried:


bash-2.05b# ./mysql.server start
bash-2.05b# Starting mysqld daemon with databases from /var/lib/mysql
040124 06:56:08 mysqld ended

I also tried to create a db as root:

bash-2.05b# mysqladmin -u root create mydb
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)'
Check that mysqld is running and that the socket: '/var/run/mysql/mysql.sock' exists!


I believe I've to start mysql as a service, but I've no idea how to do it, what to add and where. I've tried a slocate mysql.sock and it did not return anything. So, I've been reading all Friday night all over the net and looks like I'm out of options Could someone please help me out. Telling me how to start mysql (as a service or anyway that it should actually start) would be great.

Thanks a lot for the help.

P.S: it's 7h01 in the morning, so I think it's time to sleep... I will check this out as soon as I wake up, so please forgive me if I take a while to write back lol
 
Old 01-24-2004, 01:59 AM   #2
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: CentOS 5.5, Ubuntu 10.04, Linux Mint 11 gnome 64 bit
Posts: 336

Rep: Reputation: 36
This may help or hinder:
for oracle I have to start up the database first.
svrmgrl> connect internal
svrmgrl>startup
Then the listener stuff.

Mebbe search on: start mysql linux
 
Old 01-24-2004, 02:17 AM   #3
coolamit78
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RHEL AS 3/4, Windows XP
Posts: 546

Rep: Reputation: 31
cant say if this works on slack, but you can try this as root

service mysqld start

2. To set up root password for mySQL

mysqladmin -u root password -p <your-password>

3. To create a database

mysqladmin -u root -p create mydb

(where 'mydb' is the the database name)


Regards,

amit
 
Old 01-24-2004, 03:10 AM   #4
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 31
These might help you...

http://www.linuxhelp.net/guides/lamp/

http://www.linuxquestions.org/questions/history/136196

http://www.mysql.com/doc/en/Installing.html
 
Old 01-24-2004, 10:21 AM   #5
Mimicafe
LQ Newbie
 
Registered: Feb 2003
Posts: 19

Rep: Reputation: 0
Hello,

You may want to read this thread. I've outlined the necessary steps needed to get MySQL running there. If you still have any questions after reading my reply to that thread, try searching this forum for mysql - you'll get a lot of MySQL related issues.

I may stop by again, in case you're still having trouble. But first of all, try this thread:

http://www.linuxquestions.org/questi...ighlight=mysql

Good luck

Mimi
 
Old 01-24-2004, 11:21 AM   #6
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Original Poster
Rep: Reputation: 64
Wow guys, that's pretty good information. I've already bookmarked everything . Well, it seems like I will remove the .tgz packages for Slackware 9.0 and install everything from source. Looks like it won't be much of hassle after all.

I've tried all suggestions above, and safe_mysql start & started mysql, but as soon as I try to use any other command, it brings a socket issue and stops mysql. I will install everything from source, make sure everything is installed correct and get back to this thread telling how it went.

Gonna grab some coffee first .
Thank you all very much for the great replies

MMX
 
Old 01-24-2004, 01:45 PM   #7
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Original Poster
Rep: Reputation: 64
Thumbs down Not quite there yet. SQL won't run

Hi again!!!

I've been reading and trying to install MySQL for a couple of hours now, and following the links suggested here. I got mysql from source, it installed and compiled without a problem. I've followed the tutorial suggested by UltimaGuy

http://www.linuxhelp.net/guides/lamp/

To install mysql. What great tutorial btw . Very well explained. I wish more tutorials for Linux were written like that. Thanks mate! Anyway, focusing on the problem, I've tried to install and run versions 3 and 4 of mysql. Both installs perfectly, but whenever I start the service, it gives me an socket error:

Here I try to start the service:

Code:
bash-2.05b# /usr/local/mysql/bin/safe_mysqld --skip-networking >> /dev/null &
It's output is:

Code:
bash-2.05b# /usr/local/mysql/bin/safe_mysqld --skip-networking >> /dev/null &
[3] 12938
[2]   Done                    /usr/local/mysql/bin/safe_mysqld --skip-networking >>/dev/null
As suggested from mysql.com tutorial, when I tried to fire up version 4 instead of 3 of SQL, I've used "mysqld_safe" ratter then "safe_mysqld". It returns the very same message, and I thought it was running, but when I type:

Code:
bash-2.05b# mysqladmin version
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)'
I've been reading some peoples here with similar problems, and they linked the sql.sock somewhere to make it to work, but didn't tell how to do it, or where sql.sock was...ghehe. (s)locate did not find any mysql.sock either.

Any more suggestions fellows?

Thanks once again

Last edited by Mega Man X; 01-24-2004 at 01:46 PM.
 
Old 01-24-2004, 02:16 PM   #8
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,532

Rep: Reputation: 132Reputation: 132
type
ps -e | grep mysqld
to check whether mysqld is running. if not -
there are various commands to start the server like
/path/to/mysqld_safe -u root start &
or just
/etc/init.d/mysql start

good luck

Last edited by j-ray; 01-24-2004 at 02:26 PM.
 
Old 01-24-2004, 03:23 PM   #9
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Original Poster
Rep: Reputation: 64
Thanks j-ray:

Here are my outputs:

Code:
bash-2.05b# ps -e | grep mysqld
bash-2.05b#
Code:
bash-2.05b# /etc/init.d/mysql start
bash: /etc/init.d/mysql: No such file or directory
cd to the path I've installed it:

Code:
/usr/local/mysql/bin
Code:
bash-2.05b# ./safe_mysqld -u root start
Starting mysqld daemon with databases from /usr/local/mysql//var
040124 21:20:59  mysqld ended
I don't have any idea how to fix this. I was getting the very same erros with the orginal Slackware 9.0 packages
 
Old 01-25-2004, 06:15 AM   #10
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,532

Rep: Reputation: 132Reputation: 132
checkout the error log. u may find it by
locate mysqld.log
on my box it is at /var/lib/mysql/mysqld.log

check if there is a socket though the deamon is not working. there shouldnt. throw it away if so.
locate mysql.sock

maybe it starts without problem if the socket is erased cause the mysqld starts a new socket connection when started and has problems when it already exists.

good luck
 
Old 01-25-2004, 07:16 AM   #11
andrewlkho
Member
 
Registered: Jul 2003
Location: London
Posts: 548

Rep: Reputation: 30
The problem may be this: that mysql doesn't have the right priveledges. Whenever I install mysql, at the end, I always have to:
# sudo chown -R mysql /usr/local/mysql
Because otherwise it won't be able to start, and it just ends. Took me a while to figure this out. Also, I presume you've run the mysql_install_db script? mysqladmin requires mysql to be currently running...
hth
 
Old 01-28-2004, 07:33 AM   #12
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Original Poster
Rep: Reputation: 64
Thanks guys!

I've been a little bit busy this week and most likely next week too. A Java project is upon me . I will try j-ray's advice at the weekend and let you know. I've tried ho_10 advice with permissions. I don't have sudo installed, so I did an ordinary chown and chmod to the sql folder. It did not help . But thanks a lot mate. I will try to install sudo and give another shot

Thanks all again!
 
Old 01-28-2004, 09:02 AM   #13
rizza
LQ Newbie
 
Registered: Jan 2004
Posts: 12

Rep: Reputation: 0
Heya,

Did you check your /etc/my.cnf file ? In there you set the socket path for the server and the client. Alltho the client part isnt added in there by standard, so you have to add it in case mysqld_safe will start fine and mysql command gives errors concerning the socket problem mentioned above.

[client]
socket=/var/lib/mysql/mysql.sock

Thats what i added in my.cnf file to get it working.

Best regards,
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Apache/MySQL/PHP MontyPY Linux - Software 10 03-04-2005 04:14 PM
PHP and MYSQL on Apache tonyboy Linux - Software 9 03-17-2004 11:20 AM
Apache Mysql Php: mysql with php doesn't work breakerfall Linux - Networking 6 12-27-2003 09:59 PM
php-mysql-apache spako Linux - Newbie 1 08-16-2003 08:05 AM
php-nuke with apache php mysql c0c0deuz Linux - Software 0 03-30-2003 07:23 AM


All times are GMT -5. The time now is 04:08 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration