LinuxQuestions.org
Help answer threads with 0 replies.
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 08-25-2011, 09:39 AM   #1
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: LinuxMint 20 Cinnamon
Posts: 589

Rep: Reputation: 49
Having trouble getting Mysql to work...


Helo:

The 'short' of it:
Code:
bash-4.1# /etc/rc.d/rc.mysqld start
bash-4.1# 110825 10:28:37 mysqld_safe Logging to '/var/lib/mysql/lenovo.err'.
110825 10:28:37 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
110825 10:28:38 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended

bash-4.1# mysql -u root -p
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
The 'long' of it:

I down loaded and installed XAMPP from www.apachefriends.org in my attempt to set up LAMP so that I could then attempt to install Drupal 7.7.

I get the same error msg whether I use my root password or no password at all.

Does anyone know what is wrong?

Thanks,
 
Old 08-25-2011, 09:43 AM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Just for clarification have you confirmed mysql running or not?
 
Old 08-25-2011, 09:51 AM   #3
SeRi@lDiE
Member
 
Registered: Jun 2006
Location: /dev/null
Distribution: Slackware 13.1, Slackware 13.37, aptosid, rhel
Posts: 547
Blog Entries: 7

Rep: Reputation: 55
Robert,

I might be mistaken but mysql is all ready installed in the full version of slackware and there is no need for third parties....
I am running mysql in my system along with gallery3 and I did not had to install any pkgs. PhP and perl where also there.

Last edited by SeRi@lDiE; 08-25-2011 at 09:54 AM.
 
1 members found this post helpful.
Old 08-25-2011, 09:51 AM   #4
patostevens
Member
 
Registered: Dec 2007
Location: Kennewick,WA
Distribution: Slackware 14
Posts: 172

Rep: Reputation: 21
Had the same issue. this link
http://www.linuxquestions.org/questi...ighlight=mysql
solved it for me. A little bit of it is out-dated, but is easy to figure out.
 
1 members found this post helpful.
Old 08-25-2011, 10:10 AM   #5
SeRi@lDiE
Member
 
Registered: Jun 2006
Location: /dev/null
Distribution: Slackware 13.1, Slackware 13.37, aptosid, rhel
Posts: 547
Blog Entries: 7

Rep: Reputation: 55
Quote:
Originally Posted by patostevens View Post
Had the same issue. this link
http://www.linuxquestions.org/questi...ighlight=mysql
solved it for me. A little bit of it is out-dated, but is easy to figure out.
Thats a good how to. But I would still look in to this XAMPP and make sure you have not caused your current versions of the tools to brake.
 
1 members found this post helpful.
Old 08-25-2011, 10:21 AM   #6
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: LinuxMint 20 Cinnamon
Posts: 589

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by kirukan View Post
Just for clarification have you confirmed mysql running or not?
Sorry, I am so confused now and have tried so many commands, I just don't know.

What command will tell me if mysql is actually running?

I also get this:

Code:
bash-4.1# /opt/lampp/lampp start
Starting XAMPP for Linux 1.7.4...
XAMPP: Another web server daemon is already running.
XAMPP: XAMPP-MySQL is already running.
XAMPP: XAMPP-ProFTPD is already running.
XAMPP for Linux started.
Thanks,

Last edited by Robert.Thompson; 08-25-2011 at 10:36 AM.
 
Old 08-25-2011, 10:35 AM   #7
SeRi@lDiE
Member
 
Registered: Jun 2006
Location: /dev/null
Distribution: Slackware 13.1, Slackware 13.37, aptosid, rhel
Posts: 547
Blog Entries: 7

Rep: Reputation: 55
Quote:
Originally Posted by Robert.Thompson View Post
Sorry, I am so confused now and have tried so many commands, I just don't know.

What command will tell me if mysql is actually running?

Thanks,
Different options....

mysqladmin -u root -p status

You should see:

Enter password:
Uptime: 4 Threads: 1 Questions: 62 Slow queries: 0 Opens: 51 Flush tables: 1 Open tables: 45 Queries per second avg: 15.500

If you dont see that and see:

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

Than is not running but from the look of your post it looks like is not running....

Another way is:

ps aux|grep mysql

You should see mysql as a process running

Last edited by SeRi@lDiE; 08-25-2011 at 10:37 AM.
 
1 members found this post helpful.
Old 08-25-2011, 10:40 AM   #8
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: LinuxMint 20 Cinnamon
Posts: 589

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by SeRi@lDiE View Post
Different options....

mysqladmin -u root -p status

You should see:

Enter password:
Uptime: 4 Threads: 1 Questions: 62 Slow queries: 0 Opens: 51 Flush tables: 1 Open tables: 45 Queries per second avg: 15.500

If you dont see that and see:

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

Than is not running but from the look of your post it looks like is not running....

Another way is:

ps aux|grep mysql

You should see mysql as a process running
Thanks SeRi@lDiE, I get this:

Code:
bash-4.1# mysqladmin -u root -p status
Enter password: 
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysql/mysql.sock' exists!
bash-4.1# ps aux|grep mysql
root      7121  0.0  0.0   2648  1252 pts/2    S    11:32   0:00 /bin/sh /opt/lampp/bin/mysqld_safe --datadir=/opt/lampp/var/mysql --pid-file=/opt/lampp/var/mysql/lenovo.pid
nobody    7483  0.0  0.8 177596 25672 pts/2    Sl   11:32   0:00 /opt/lampp/sbin/mysqld --basedir=/opt/lampp --datadir=/opt/lampp/var/mysql --plugin-dir=/opt/lampp/lib/mysql/plugin --user=nobody --log-error=/opt/lampp/var/mysql/lenovo.err --pid-file=/opt/lampp/var/mysql/lenovo.pid --socket=/opt/lampp/var/mysql/mysql.sock --port=3306
root      7778  0.0  0.0   2020   508 pts/2    S+   11:37   0:00 grep mysql
bash-4.1#
But XAMPP says that it is running!

Last edited by Robert.Thompson; 08-25-2011 at 10:47 AM.
 
Old 08-25-2011, 10:45 AM   #9
SeRi@lDiE
Member
 
Registered: Jun 2006
Location: /dev/null
Distribution: Slackware 13.1, Slackware 13.37, aptosid, rhel
Posts: 547
Blog Entries: 7

Rep: Reputation: 55
Quote:
Originally Posted by Robert.Thompson View Post
Thanks SeRi@lDiE, I get this:

Code:
bash-4.1# mysqladmin -u root -p status
Enter password: 
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysql/mysql.sock' exists!
bash-4.1# ps aux|grep mysql
root      7121  0.0  0.0   2648  1252 pts/2    S    11:32   0:00 /bin/sh /opt/lampp/bin/mysqld_safe --datadir=/opt/lampp/var/mysql --pid-file=/opt/lampp/var/mysql/lenovo.pid
nobody    7483  0.0  0.8 177596 25672 pts/2    Sl   11:32   0:00 /opt/lampp/sbin/mysqld --basedir=/opt/lampp --datadir=/opt/lampp/var/mysql --plugin-dir=/opt/lampp/lib/mysql/plugin --user=nobody --log-error=/opt/lampp/var/mysql/lenovo.err --pid-file=/opt/lampp/var/mysql/lenovo.pid --socket=/opt/lampp/var/mysql/mysql.sock --port=3306
root      7778  0.0  0.0   2020   508 pts/2    S+   11:37   0:00 grep mysql
bash-4.1#
Robert,

Looks like your XAMPP installation might have cause some issues.

To me it looks like mysql is running using the xampp version and when you are trying to execute the rc.mysql it looks for the local mysql as you can see its looking for the socket under /var/run/mysql/mysql.sock which is the default path for the mysql socket under slackware.... You will have to modify the start script to look at your xampp verssion... or you can ignore the start up script and add to your path /opt/the/xampp/version/ and create your own start up script.

My 2 centavos:

Start all over again and use the slackware version of mysql.

Last edited by SeRi@lDiE; 08-25-2011 at 10:53 AM.
 
1 members found this post helpful.
Old 08-25-2011, 10:57 AM   #10
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: LinuxMint 20 Cinnamon
Posts: 589

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by SeRi@lDiE View Post
Robert,

Looks like your XAMPP installation might have cause some issues.

To me it looks like mysql is running using the xampp version and when you are trying to execute the rc.mysql it looks for the local socket under /var/run/mysql/mysql.sock which is the default path for the mysql socket under slackware.... You will have to modify the start script to look at your xampp verssion... or you can ignore the start up script and add to your path /opt/the/xampp/version/ and create your own start up script.
Thanks SeRi@lDiE.

In anticipation of screwing things up, I made a complete backup of my fresh Slackware 13.37 install before messing around with XAMPP, so, I'm going to format /dev/sda1 (root) and reinstall.

Then I'll try again.
 
Old 08-25-2011, 11:09 AM   #11
SeRi@lDiE
Member
 
Registered: Jun 2006
Location: /dev/null
Distribution: Slackware 13.1, Slackware 13.37, aptosid, rhel
Posts: 547
Blog Entries: 7

Rep: Reputation: 55
Quote:
Originally Posted by Robert.Thompson View Post
Thanks SeRi@lDiE.

In anticipation of screwing things up, I made a complete backup of my fresh Slackware 13.37 install before messing around with XAMPP, so, I'm going to format /dev/sda1 (root) and reinstall.

Then I'll try again.
Robert,

You dont have to format... You can just remove the xampp version... Just look at where the files are located... It seem they are in opt.
reformatting is a bit drastic no?
 
1 members found this post helpful.
Old 08-25-2011, 11:20 AM   #12
ecki_
LQ Newbie
 
Registered: Jul 2011
Posts: 7

Rep: Reputation: Disabled
I had a similar problem after installing Slackware. MySQL just wouldn't start. The MySQL log files also were not very helpful. And then I discovered the comments at the start of /etc/rc.d/rc.mysqld:

Code:
# Before you can run MySQL, you must have a database.  To install an initial
# database, do this as root:
#
#   mysql_install_db --user=mysql
#
# Note that the mysql user must exist in /etc/passwd, and the created files
# ...
Maybe running mysql_install_db does the job for you also.
 
1 members found this post helpful.
Old 08-25-2011, 11:33 AM   #13
SeRi@lDiE
Member
 
Registered: Jun 2006
Location: /dev/null
Distribution: Slackware 13.1, Slackware 13.37, aptosid, rhel
Posts: 547
Blog Entries: 7

Rep: Reputation: 55
Quote:
Originally Posted by ecki_ View Post
I had a similar problem after installing Slackware. MySQL just wouldn't start. The MySQL log files also were not very helpful. And then I discovered the comments at the start of /etc/rc.d/rc.mysqld:

Code:
# Before you can run MySQL, you must have a database.  To install an initial
# database, do this as root:
#
#   mysql_install_db --user=mysql
#
# Note that the mysql user must exist in /etc/passwd, and the created files
# ...
Maybe running mysql_install_db does the job for you also.
While you are right I can see that mysql is running in hess output...
I think hess problem is that he is running a different mysql version on a different path so while mysql is running he is trying to call and execute mysql from the local install instead of the third party making mysql error out... He could continue to use the xmpp version all he has to do is add it to hess path but than he will have to modify start up scripts to look at the correct mysql version, etc...

Last edited by SeRi@lDiE; 08-25-2011 at 11:34 AM.
 
1 members found this post helpful.
Old 08-25-2011, 11:37 AM   #14
Robert.Thompson
Member
 
Registered: Nov 2009
Location: Montreal, Quebec, Canada
Distribution: LinuxMint 20 Cinnamon
Posts: 589

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by SeRi@lDiE View Post
Robert,

You dont have to format... You can just remove the xampp version... Just look at where the files are located... It seem they are in opt.
reformatting is a bit drastic no?
Hi SeRi@lDiE:

Drastic? Well, maybe...

You see, I really don't know what I am doing a lot of the time. In the past 2 days I have issued many commands and edited many config files in my attempt to get things set up to install Drupal. God only knows what I have done to my fresh Slackware installation.

So, before I started down this road, I did a fresh DVD install and then added the software that I had successfully installed before. Then I used clonezilla to make image back ups of root and home. (all my data is living in a separate partition and in Dropbox)

Now, I can format to clobber everything that I have screwed up, reinstall my back up and know that I have a clean starting point.

I guess you could call this a Newbie's approach to installing software in Slackware.
 
1 members found this post helpful.
Old 08-25-2011, 11:41 AM   #15
SeRi@lDiE
Member
 
Registered: Jun 2006
Location: /dev/null
Distribution: Slackware 13.1, Slackware 13.37, aptosid, rhel
Posts: 547
Blog Entries: 7

Rep: Reputation: 55
Quote:
Originally Posted by Robert.Thompson View Post
Hi SeRi@lDiE:

Drastic? Well, maybe...

You see, I really don't know what I am doing a lot of the time. In the past 2 days I have issued many commands and edited many config files in my attempt to get things set up to install Drupal. God only knows what I have done to my fresh Slackware installation.

So, before I started down this road, I did a fresh DVD install and then added the software that I had successfully installed before. Then I used clonezilla to make image back ups of root and home. (all my data is living in a separate partition and in Dropbox)

Now, I can format to clobber everything that I have screwed up, reinstall my back up and know that I have a clean starting point.

I guess you could call this a Newbie's approach to installing software in Slackware.
Ah what a beautiful tool... Clonezilla.
I dont know where I be if clonezilla didn't exist

Good call on using clonezilla.

Good luck.... I Hope I was helpful
 
  


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
[SOLVED] su mysql doesn't work if mysql is running? ranko_6 Slackware 3 12-20-2010 02:05 PM
Need help. The classic error: can't get php5 to work with mysql. - - without-mysql retry Linux - Server 3 05-27-2008 06:38 PM
Mysql 5.0.41 trouble. Sn!per[SWE] Linux - Server 0 05-11-2007 09:09 AM
Deleted the mysql db files from /var/lib/mysql and reinstalling doesn't work! Frostblade Linux - Software 1 05-24-2006 10:16 AM
MySQL trouble gruger Linux - Networking 3 07-14-2003 12:47 PM

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

All times are GMT -5. The time now is 11:55 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