LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-08-2006, 10:29 AM   #1
scrupul0us
Member
 
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159

Rep: Reputation: 30
Question WTF mysql.. run damn you!


So whats the deal with mysql as installed with slack 10.2? everytime i try to run the mysql command i get the follow error:

"Cant connect to the local mysql server through socket '/var/run/mysql/mysql.sock' (2)"

scratches head...

also, where are the DB files stored? in a windows env they were stored in mysql/bin/

neither myself nor slocate can find that path

HELP
 
Old 01-08-2006, 11:03 AM   #2
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 154Reputation: 154
mysql is the client program.

Can you briefly outline the steps you have already done in getting mysql setup

The error you specified means that either the mysql daemon isn't running, or the client is expecting the socket file to be in a different location that where mysqld is putting it.

Normally mysql data files are stored somewhere under /var. I *think* its /var/lib/mysql - I always move it elsewhere where there is more space and where I can more easily back up the data
 
Old 01-08-2006, 11:17 AM   #3
scrupul0us
Member
 
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159

Original Poster
Rep: Reputation: 30
i havent tocuhed mysql at all... i did a full install of slack 10.2 so i just assumed it would be setup and running (since apache was) and all id have todo was config it

i tried googling for a setup for 10.2 but found nothin
 
Old 01-08-2006, 11:24 AM   #4
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 154Reputation: 154
Ok,

if you do:
Code:
$ su -
# su - mysql
$ mysql_install_db
$ exit
# chmod 755 /etc/rc.d/rc.mysqld
# /etc/rc.d/rc.mysqld start
# exit
note that you must run mysql_install_db as user mysql which is done by `su - mysql`

That should do it, reading /etc/rc.d/rc/mysqld /var/lib/mysql is indeed the default location for mysql databases.

Remember the mysql root password will be blank at this point.
 
Old 01-08-2006, 01:55 PM   #5
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Mysql is not fully configured in default Slackware installation. You must configure it yourself as phil.d.g told. As well, read this /etc/rc.d/rc.mysqld.

Last edited by Alien_Hominid; 01-08-2006 at 01:57 PM.
 
Old 01-08-2006, 02:06 PM   #6
scrupul0us
Member
 
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159

Original Poster
Rep: Reputation: 30
phil that worked nicely... i also changed the pw for root using

Code:
#mysqladmin -u root password "newpassword"
only issue now is that phpmyadmin reports:

Code:
#2013 - Lost connection to MySQL server during query
when i try to login using root and the new password

im using the same phpmyadmin setup as before and dont see anything inside config.inc.php should change, but i looked that over just to be sure

also.. what and where do i edit so that mysql starts at boot

Last edited by scrupul0us; 01-08-2006 at 02:09 PM.
 
Old 01-08-2006, 02:28 PM   #7
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
Code:
less /etc/rc.d/rc.mysqld # All the info you need
sh /etc/rc.d/rc.mysqld start # Start mysql
chmod +x /etc/rc.d/rc.mysqld # Make mysql start at boot

Last edited by shilo; 01-08-2006 at 02:29 PM.
 
Old 01-08-2006, 04:12 PM   #8
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 154Reputation: 154
By chmodding the rc script to 755 you made it so that mysqld starts on boot up.

I think the problem may be because mysqld isn't listening on a tcp port, in phpmyadmin's config.inc.php change the connection type to socket and the socket location to /var/run/mysql/mysql.sock


---
FOR MYSQLD: Now you have got it running you may want to read the my-*.cnf in /etc files and write a my.cnf to optimise mysql a bit for your circumstances and set your own options, as well as reading /etc/rc.d/rc.mysqld
 
Old 01-08-2006, 07:35 PM   #9
scrupul0us
Member
 
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159

Original Poster
Rep: Reputation: 30
ok.. i did the chmod and changed the type to SOCK and entered the SOCK path and i still get the same error
 
Old 01-08-2006, 07:52 PM   #10
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
use "ps aux" to verify mysql is running. Manually verify that the databases all have the correct ownership.
 
Old 01-08-2006, 08:48 PM   #11
scrupul0us
Member
 
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159

Original Poster
Rep: Reputation: 30
mysql is running ownership is mysql mysql
 
Old 01-09-2006, 07:47 AM   #12
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 154Reputation: 154
Can you connect with the mysql client
Code:
mysql -u root -p
after supplying your password you should be greeted with some information about the mysql server and the mysql prompt:
Code:
mysql>
 
Old 01-09-2006, 11:25 AM   #13
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
You may need to comment SKIP="--skip-networking" in /etc/rc.d/rc.mysqld if your program connects using a tcp port.
Also there are some sample configuration files in /etc, all of them end with .cnf. Copy the one you need as /etc/my.cnf
 
Old 01-09-2006, 04:13 PM   #14
scrupul0us
Member
 
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159

Original Poster
Rep: Reputation: 30
i got it to work... in the config.inc.php:

Code:
$cfg['Servers'][$i]['host']
was set to:

Code:
'http://www.myhost.com';
the only way itll work now is if i set it to:

Code:
'localhost';
strange but oh well it works
 
Old 01-09-2006, 04:24 PM   #15
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 154Reputation: 154
Its probably because mysql isn't listening on a tcp port, only through that socket file. Unless you have remote clients connecting to mysql then there is no need to change this
 
  


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
can't run mysql ekaja Linux - Software 3 12-18-2004 01:56 PM
MySQL ended... wtf? :( ilhbutshm Linux - Software 5 12-09-2004 07:48 AM
Damn mouse is freezing now, WTF? Slovak Linux - Hardware 6 12-02-2004 08:57 PM
MYsql can't run ekaja Slackware - Installation 2 11-15-2004 04:58 AM
MySQL cant run run-all-tests demmylls Linux - Software 5 02-18-2004 02:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:02 AM.

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