LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-22-2018, 05:09 PM   #1
maschelsea
Member
 
Registered: Dec 2016
Distribution: Slackware 64bit 14.2
Posts: 468

Rep: Reputation: Disabled
Mysql: Error 2002


First of all, I apologize for asking this here. I know that this is probably not a Slackware question, but I am asking it here because I am running Slackware 64 14.2. I have a notoriously short attention span, which I am sure will interfere at some point or other, in dealing with this issue. I have found out in my researches of the past hour that this problem can often be caused by disk space issues. I have eliminated that:

Code:
root@caitlyn:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       707G  273G  399G  41% /
devtmpfs        3.9G     0  3.9G   0% /dev
tmpfs           3.9G  1.1M  3.9G   1% /run
tmpfs           3.9G  176K  3.9G   1% /dev/shm
cgroup_root     3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda5        96G   47G   45G  52% /home
cgmfs           100K     0  100K   0% /run/cgmanager/fs
Plenty of disk space.

Here is the actual error:
Code:
root@caitlyn:~# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory")
Code:
root@caitlyn:~# ls -l /var/run/mysql/
total 0
As you can see, files that should be there are not. I suspected that mysql was not running, so I issued

Code:
root@caitlyn:~# ps -ef | grep mysql
root     19465  1789  0 17:05 pts/1    00:00:00 grep mysql
which confirms that it is NOT running. I then chmod +x to /etc/rc.d/rc.mysqld and then

Code:
root@caitlyn:~# /etc/rc.d/rc.mysqld start
root@caitlyn:~# 180122 17:06:14 mysqld_safe Logging to '/var/lib/mysql/caitlyn.err'.
180122 17:06:14 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
I looked at /var/lib/mysql/caitlyn_error:
Code:
root@caitlyn:~# cat /var/lib/mysql/caitlyn.err 
180122 16:55:28 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
180122 16:55:28 [Note] /usr/libexec/mysqld (mysqld 10.0.33-MariaDB) starting as process 19387 ...
180122 16:55:30 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

180122 16:55:30 [Note] InnoDB: Using mutexes to ref count buffer pool pages
180122 16:55:30 [Note] InnoDB: The InnoDB memory heap is disabled
180122 16:55:30 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
180122 16:55:30 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
180122 16:55:30 [Note] InnoDB: Compressed tables use zlib 1.2.8
180122 16:55:30 [Note] InnoDB: Using Linux native AIO
180122 16:55:30 [Note] InnoDB: Using CPU crc32 instructions
180122 16:55:30 [Note] InnoDB: Initializing buffer pool, size = 128.0M
180122 16:55:30 [Note] InnoDB: Completed initialization of buffer pool
180122 16:55:30 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
180122 16:55:30 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
180122 16:55:30 [Note] InnoDB: Database physically writes the file full: wait...
180122 16:55:30 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
180122 16:55:30 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
180122 16:55:31 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
180122 16:55:31 [Warning] InnoDB: New log files created, LSN=45781
180122 16:55:31 [Note] InnoDB: Doublewrite buffer not found: creating new
180122 16:55:31 [Note] InnoDB: Doublewrite buffer created
180122 16:55:31 [Note] InnoDB: 128 rollback segment(s) are active.
180122 16:55:31 [Warning] InnoDB: Creating foreign key constraint system tables.
180122 16:55:31 [Note] InnoDB: Foreign key constraint system tables created
180122 16:55:31 [Note] InnoDB: Creating tablespace and datafile system tables.
180122 16:55:31 [Note] InnoDB: Tablespace and datafile system tables created.
180122 16:55:31 [Note] InnoDB: Waiting for purge to start
180122 16:55:31 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.36-82.2 started; log sequence number 0
180122 16:55:31 [Note] Plugin 'FEEDBACK' is disabled.
180122 16:55:31 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
180122 16:55:31 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
180122 16:55:31 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
180122 16:55:31 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended
180122 17:06:14 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
180122 17:06:14 [Note] /usr/libexec/mysqld (mysqld 10.0.33-MariaDB) starting as process 19546 ...
180122 17:06:14 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

180122 17:06:14 [Note] InnoDB: Using mutexes to ref count buffer pool pages
180122 17:06:14 [Note] InnoDB: The InnoDB memory heap is disabled
180122 17:06:14 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
180122 17:06:14 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
180122 17:06:14 [Note] InnoDB: Compressed tables use zlib 1.2.8
180122 17:06:14 [Note] InnoDB: Using Linux native AIO
180122 17:06:14 [Note] InnoDB: Using CPU crc32 instructions
180122 17:06:14 [Note] InnoDB: Initializing buffer pool, size = 128.0M
180122 17:06:15 [Note] InnoDB: Completed initialization of buffer pool
180122 17:06:15 [Note] InnoDB: Highest supported file format is Barracuda.
180122 17:06:15 [Note] InnoDB: Starting crash recovery from checkpoint LSN=49463
180122 17:06:15 [Note] InnoDB: Restoring possible half-written data pages from the doublewrite buffer...
180122 17:06:15 [Note] InnoDB: Starting final batch to recover 11 pages from redo log
180122 17:06:15 [Note] InnoDB: 128 rollback segment(s) are active.
180122 17:06:15 [Note] InnoDB: Waiting for purge to start
180122 17:06:15 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.36-82.2 started; log sequence number 1600607
180122 17:06:15 [Note] Plugin 'FEEDBACK' is disabled.
180122 17:06:15 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
180122 17:06:15 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
180122 17:06:15 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
180122 17:06:15 mysqld_safe mysqld from pid file /var/run/mysql/mysql.pid ended
And I start to get a little overwhelmed. It LOOKS like I should run mysql_upgrade, but when I do, I see:

Code:
root@caitlyn:~# mysql_upgrade
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory")
FATAL ERROR: Upgrade failed
I have not used mysql since I installed Slackware last January, which might be causing some of my problems. Running mysql_secure_installation just asks for my root password a bunch of times and tells me that it can't do anything because of Error 2002. What should I do? Thank you in advance for any advice you can offer...
 
Old 01-22-2018, 05:17 PM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
You have to read /etc/rc.d/rc.mysqld to install mysql:
Code:
# Before you can run MariaDB, you must have a database.  To install an initial
# database, do this as root:
#
#   mysql_install_db --user=mysql

# To increase system security, consider using "mysql_secure_installation"
# as well.  For more information on this tool, please read:
#   man mysql_secure_installation
I suggest to run mysql_secure_installation after mysql_install_db --user=mysql, it will secure installation and will prompt for a password to set mysql root password

Last edited by keefaz; 01-22-2018 at 05:19 PM.
 
Old 01-22-2018, 08:10 PM   #3
maschelsea
Member
 
Registered: Dec 2016
Distribution: Slackware 64bit 14.2
Posts: 468

Original Poster
Rep: Reputation: Disabled
Thank you for your assistance.
 
  


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
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Software 3 06-28-2007 11:46 AM
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.so amee_stars Linux - Newbie 2 01-22-2007 02:48 AM
MySql error 2002, Cannot start mysql djchris Linux - Software 5 04-13-2004 06:12 PM

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

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