LinuxQuestions.org
Visit Jeremy's Blog.
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 10-14-2014, 06:42 AM   #1
prasan89na
LQ Newbie
 
Registered: Sep 2014
Posts: 12

Rep: Reputation: Disabled
running mysql


Successfully installed XAMPP in my Slackware Linux. But when I try to run mysql it says:
bash-4.2$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)

XAMPP says that mysql server is already running.
 
Old 10-15-2014, 03:58 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,197

Rep: Reputation: 867Reputation: 867Reputation: 867Reputation: 867Reputation: 867Reputation: 867Reputation: 867
MySql is VERY particular about permissions and ownership after installing it on LFS I run these commands ( as root )
Code:
mysql_install_db --basedir=/usr --datadir=/srv/mysql --user=mysql
chown -R mysql:mysql /srv/mysql

install -v -m755 -o mysql -g mysql -d /run/mysqld
mysqld_safe --user=mysql 2>&1 >/dev/null &

mysqladmin -u root password

mysqladmin -p shutdown
On my system /var/run is symlinked to /run or /run is symlinked to /var/run whatever way you want to put it
 
Old 10-15-2014, 04:01 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,306
Blog Entries: 24

Rep: Reputation: 4259Reputation: 4259Reputation: 4259Reputation: 4259Reputation: 4259Reputation: 4259Reputation: 4259Reputation: 4259Reputation: 4259Reputation: 4259Reputation: 4259
Quote:
Originally Posted by prasan89na View Post
Successfully installed XAMPP in my Slackware Linux. But when I try to run mysql it says:
bash-4.2$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)

XAMPP says that mysql server is already running.
Just curious, why install XAMPP on Slackware? (You may have a reason I have not thought of)

Slackware already has everything natively in case you did not know that.
 
Old 10-17-2014, 01:50 AM   #4
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
If you want to open mysql command prompt like this
Code:
mysql>
Run the command
Code:
/opt/lampp/bin/mysql
Code:
bash-4.2$ sudo /opt/lampp/bin/mysql
 
Old 10-17-2014, 02:43 AM   #5
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Might be that mysql server not listening on a socket or that it is in a different place. Thus first check if mysql is running
Quote:
ps aux | grep mysql
If its running check the existence of the socket file.
Quote:
ls /var/run/mysql
You might check on the config file of mysql. Might give a hint. (Not sure about the path)
Quote:
less /etc/my.cnf
Or you could run mysqld in debug mode and see what the server says when you try to connect
 
  


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
MySQL - How to Get it Running chome4 Linux - General 3 03-01-2012 07:34 PM
[SOLVED] yum install php-mysql create problem to my running mysql database jsaravana87 Linux - Server 1 08-11-2011 04:24 AM
[SOLVED] su mysql doesn't work if mysql is running? ranko_6 Slackware 3 12-20-2010 03:05 PM
MySQL: two running Zeno McDohl Linux - Server 5 08-16-2007 07:26 PM
running mysql ?? shaahul Linux - Software 1 09-03-2003 03:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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