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 10-03-2009, 07:56 AM   #1
simeon.mattes
Member
 
Registered: Feb 2009
Posts: 60

Rep: Reputation: 15
MYSQL issue in slackware 13.0


Hi,

I have installed slackware 13.0 in my pc and I use the the build-in mysql server that slackware has. Every time my computer starts I receive the following error:

Code:
Starting mysqld daemon with databases from /var/laib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid

Every time I try to restart mysql server with the following command:

Code:
/etc/rc.d/rc.mysqld restart
I get the error:

Code:
root@slackfractals:/home/simeon# nohup: redirecting stderr to stdout
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid
091003 15:49:23  mysqld ended
Every time I try to run mysql command I get the error message:
Code:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)

I was looking around in the Internet to find a solution, but without any success. The only things I found out are:
  • There is no mysql.sock file in my whole computer
  • and my /var/lib/mysql/slackfractals.err file has the following errors:


    Code:
    091003 15:37:22  mysqld started
    091003 15:37:22 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
    091003 15:37:22 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
    InnoDB: Log scan progressed past the checkpoint lsn 0 36808
    091003 15:37:22  InnoDB: Database was not shut down normally!
    InnoDB: Starting crash recovery.
    InnoDB: Reading tablespace information from the .ibd files...
    InnoDB: Restoring possible half-written data pages from the doublewrite
    InnoDB: buffer...
    InnoDB: Doing recovery: scanned up to log sequence number 0 43655
    091003 15:37:22  InnoDB: Starting an apply batch of log records to the database...
    InnoDB: Progress in percents: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
    52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
    InnoDB: Apply batch completed
    091003 15:37:23  InnoDB: Started; log sequence number 0 43655
    091003 15:37:23 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
    091003 15:37:23 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
    091003 15:37:23 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
    091003 15:37:23  mysqld ended
    Any suggestions?
 
Old 10-03-2009, 08:02 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Did you initially install the database (mysql_install_db command) and set a password (mysqladmin command) for the mysql root user? Also check to see if there is a /etc/my.cnf file present.

I do believe the rc.mysql file has this info inside it.

Hope this helps.
 
Old 10-03-2009, 06:33 PM   #3
simeon.mattes
Member
 
Registered: Feb 2009
Posts: 60

Original Poster
Rep: Reputation: 15
hi druuna,

thanks for your response. Actually I didn't install anything. I just installed the packages for mysql, which are offered from slackware.

Nevertheless, I run mysql_install_db and I get the following:

Code:
Installing MySQL system tables...      
091004  2:27:52 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
091004  2:27:52 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
OK                                                                                                          
Filling help tables...                                                                                      
091004  2:27:52 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
091004  2:27:52 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
OK                                                                                                          

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h slackfractals password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
Then, I run mysql_secure_installation and I get:

Code:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY! 


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
Enter current password for root (enter for none):
I tried to find the my.cnf file without any success, but I found my-huge.cnf, my-large.cnf, my-medium.cnf and my-small.cnf. I copied my-large.cnf as my.cnf which contains:
Code:
# Example MySQL config file for large systems.
#                                             
# This is for a large system with memory = 512M where the system runs mainly
# MySQL.                                                                    
#                                                                           
# You can copy this file to                                                 
# /etc/my.cnf to set global options,                                        
# mysql-data-dir/my.cnf to set server-specific options (in this             
# installation this directory is /var/lib/mysql) or                         
# ~/.my.cnf to set user-specific options.                                   
#                                                                           
# In this file, you can use all long options that a program supports.       
# If you want to know which options a program supports, run the program     
# with the "--help" option.                                                 

# The following options will be passed to all MySQL clients
[client]                                                   
#password       = your_password                            
port            = 3306                                     
socket          = /var/run/mysql/mysql.sock                

# Here follows entries for some specific programs

# The MySQL server
[mysqld]          
port            = 3306
socket          = /var/run/mysql/mysql.sock
skip-locking                               
key_buffer = 256M                          
max_allowed_packet = 1M                    
table_cache = 256                          
sort_buffer_size = 1M                      
read_buffer_size = 1M                      
read_rnd_buffer_size = 4M                  
myisam_sort_buffer_size = 64M              
thread_cache_size = 8                      
query_cache_size= 16M                      
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8                        

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.    
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows      
# (via the "enable-named-pipe" option) will render mysqld useless!         
#                                                                          
#skip-networking                                                           

# Disable Federated by default
skip-federated                

# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin                           

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set  
# but will not function as a master if omitted
server-id       = 1                           

# Replication Slave (comment out master section to use this)
#                                                           
# To configure this host as a replication slave, you can choose between
# two methods :                                                        
#                                                                      
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
#    the syntax is:                                                    
#                                                                      
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,          
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;                  
#                                                                      
#    where you replace <host>, <user>, <password> by quoted strings and
#    <port> by the master's port number (3306 by default).             
#                                                                      
#    Example:                                                          
#                                                                      
#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,    
#    MASTER_USER='joe', MASTER_PASSWORD='secret';                      
#                                                                      
# OR                                                                   
#                                                                      
# 2) Set the variables below. However, in case you choose this method, then
#    start replication for the first time (even unsuccessfully, for example
#    if you mistyped the password in master-password and the slave fails to
#    connect), the slave will create a master.info file, and any later     
#    change in this file to the variables' values below will be ignored and
#    overridden by the content of the master.info file, unless you shutdown
#    the slave server, delete master.info and restart the slaver server.   
#    For that reason, you may want to leave the lines below untouched      
#    (commented) and instead use CHANGE MASTER TO (see above)              
#                                                                          
# required unique id between 2 and 2^32 - 1                                
# (and different from the master)                                          
# defaults to 2 if master-host is set                                      
# but will not function as a slave if omitted                              
#server-id       = 2                                                       
#                                                                          
# The replication master for this slave - required                         
#master-host     =   <hostname>                                            
#                                                                          
# The username the slave will use for authentication when connecting       
# to the master - required                                                 
#master-user     =   <username>                                            
#                                                                          
# The password the slave will authenticate with when connecting to         
# the master - required                                                    
#master-password =   <password>                                            
#                                                                          
# The port the master is listening on.                                     
# optional - defaults to 3306                                              
#master-port     =  <port>                                                 
#                                                                          
# binary logging - not required for slaves, but recommended                
#log-bin=mysql-bin                                                         

# Point the following paths to different dedicated disks
#tmpdir         = /tmp/                                 
#log-update     = /path-to-dedicated-directory/hostname 

# Uncomment the following if you are using BDB tables
#bdb_cache_size = 64M                                
#bdb_max_lock = 100000                               

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql/                 
#innodb_data_file_path = ibdata1:10M:autoextend         
#innodb_log_group_home_dir = /var/lib/mysql/            
#innodb_log_arch_dir = /var/lib/mysql/                  
# You can set .._buffer_pool_size up to 50 - 80 %       
# of RAM but beware of setting memory usage too high    
#innodb_buffer_pool_size = 256M                         
#innodb_additional_mem_pool_size = 20M                  
# Set .._log_file_size to 25 % of buffer pool size      
#innodb_log_file_size = 64M                             
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

What else could I do;
 
Old 10-04-2009, 04:43 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

I do believe that the mysql db must be running before you execute the mysql_secure_installation part (never used it myself. I use the /usr/bin/mysqladmin -u root password 'new-password' part, and the db must be up and running for that one).

Start the db with the following statement: mysqld_safe --user=mysql 2>&1 >/dev/null & and try the mysql_secure_installation step again. I'm fairly sure this time it will work.

BTW: Do you really need the large.cnf? Most of the time (home usage) medium or small will do fine.

In short these are the basic steps to take after installing mysql:

1) Install database: mysql_install_db --user=mysql,
2) Start mysql: mysqld_safe --user=mysql 2>&1 >/dev/null &,
3) Set root password: mysqladmin -u root password 'new-password' (or use the mysql_secure_installation command),
4) Stop mysql: mysqladmin -p shutdown (passwd will be asked).
Done.

Hope this helps.
 
Old 10-04-2009, 12:50 PM   #5
simeon.mattes
Member
 
Registered: Feb 2009
Posts: 60

Original Poster
Rep: Reputation: 15
Unfortunately I didn't have any success. Here are my results.
  1. mysqld_safe --user=mysql 2>&1 >/dev/null &
    Code:
    [1] 3432
    root@slackfractals:/home# nohup: ignoring input and redirecting stderr to stdout
  2. mysql_secure_installation
    Code:
    NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
          SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
    
    
    In order to log into MySQL to secure it, we'll need the current
    password for the root user.  If you've just installed MySQL, and
    you haven't set the root password yet, the password will be blank,
    so you should just press enter here.
    
    Enter current password for root (enter for none):
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run                                       /mysql/mysql.sock' (2)
    Enter current password for root (enter for none):
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
    Enter current password for root (enter for none): [1]   Done                    mysqld_safe --user=mysql 2>&1 >/dev/null
    
    [2]+  Stopped                 mysql_secure_installation


With the other steps you gave me I had the following result:
1) Install database: mysql_install_db --user=mysql,

Code:
Installing MySQL system tables...
091004 20:49:06 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
091004 20:49:06 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
ERROR: 1347  'mysql.db' is not BASE TABLE
091004 20:49:06 [ERROR] Aborting

091004 20:49:06 [Note] /usr/libexec/mysqld: Shutdown complete

Installation of system tables failed!

Examine the logs in /var/lib/mysql for more information.
You can try to start the mysqld daemon with:
/usr/libexec/mysqld --skip-grant &
and use the command line tool
/usr/bin/mysql to connect to the mysql
database and look at the grant tables:

shell> /usr/bin/mysql -u root mysql
mysql> show tables

Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /var/lib/mysql that may be helpful.

The latest information about MySQL is available on the web at
http://www.mysql.com
Please consult the MySQL manual section: 'Problems running mysql_install_db',
and the manual section that describes problems on your OS.
Another information source is the MySQL email archive.
Please check all of the above before mailing us!
And if you do mail us, you MUST use the /usr/bin/mysqlbug script!
In my /var/lib/mysql two files have been created ,i.e. mysql-bin.000001 mysql-bin.index

mysql-bin.index
Code:
./mysql-bin.000001
mysql-bin.000001
Code:
 offset    0  1  2  3   4  5  6  7   8  9  a  b   c  d  e  f  0123456789abcdef
00000000 <fe>62 69 6e  02 e1 c8 4a  0f 01 00 00  00 5e 00 00  ώbin.αΘJ.....^..
00000010  00 62 00 00  00 00 00 04  00 35 2e 30  2e 38 34 2d  .b.......5.0.84-
00000020  6c 6f 67 00  00 00 00 00  00 00 00 00  00 00 00 00  log.............
00000030  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
00000040  00 00 00 00  00 00 00 00  00 00 00 02  e1 c8 4a 13  ............αΘJ.
00000050  38 0d 00 08  00 12 00 04  04 04 04 12  00 00 4b 00  8.............K.
00000060  04 1a 02 e1  c8 4a 03 01  00 00 00 13  00 00 00 75  ...αΘJ.........u
00000070  00 00 00 00  00                                     .....

Last edited by simeon.mattes; 10-04-2009 at 12:57 PM.
 
Old 10-04-2009, 01:04 PM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
Check that /var/lib/mysql and all files in it be owned by user mysql:mysql. If not, chown -R mysql:mysql /var/lib/mysql.
 
Old 10-04-2009, 01:15 PM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
I have to agree with Didier Spaier.

You (simeon.mattes) have been trying out some different solutions (I do believe with and without the --user=mysql option), which probably messed up the permissions on (some of) the mysql files.

This being a fresh install you could always decide to uninstall mysql and reinstall it fresh and apply the 4 steps I mentioned in post #4.
 
Old 10-04-2009, 02:50 PM   #8
simeon.mattes
Member
 
Registered: Feb 2009
Posts: 60

Original Poster
Rep: Reputation: 15
I think I managed to configure it. It seems that it works. Actually I reinstalled mysql through slackpkg after I had removed /var/lib/mysql and I run the steps you have told me.

Though I can't run a .php file in my domain. I get the content of my php file instead. I'll look it out again and if I don't manage to configure it I 'll ask.

Thanks.

Last edited by simeon.mattes; 10-04-2009 at 02:52 PM.
 
Old 10-04-2009, 03:05 PM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

This:
Quote:
Though I can't run a .php file in my domain. I get the content of my php file instead. I'll look it out again and if I don't manage to configure it I 'll ask.
has nothing to do with mysql.

Php and apache work closely together, I do believe you need to uncomment a line in your httpd.conf file to "activate" php.
Look for these:
Quote:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
You do need to restart apache after editing the httpd.conf file.

Hope this helps.
 
Old 10-04-2009, 03:16 PM   #10
simeon.mattes
Member
 
Registered: Feb 2009
Posts: 60

Original Poster
Rep: Reputation: 15
Yes, I know it...I had already done it.

Thanks again
 
Old 10-04-2009, 03:27 PM   #11
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
Thats not all.

If not yet done, you also have to uncomment (remove the leading '#') following line near the end of httpd.conf:
Code:
#Include /etc/httpd/mod_php.conf
and replace:
Code:
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>
by:
Code:
<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>
 
Old 11-03-2010, 03:00 PM   #12
mpagnan
Member
 
Registered: Apr 2003
Location: Canada
Distribution: Mint KDE 18.2
Posts: 33

Rep: Reputation: 5
Druuna,
I have run into the same problems that this old thread deals with and your suggestions do not work. Going through the following steps, as you suggest, fail:

1) Install database: mysql_install_db --user=mysql,
2) Start mysql: mysqld_safe --user=mysql 2>&1 >/dev/null &,
3) Set root password: mysqladmin -u root password 'new-password' (or use the mysql_secure_installation command),
4) Stop mysql: mysqladmin -p shutdown (passwd will be asked).

Steps 1 & 2 work, it seems. Step 3 bombs with this:
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!

Using mysql_secure_installation it croaks when it asks for the root password. Whether I leave it blank or enter the old password, I get this:
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
Enter current password for root (enter for none):


This message from the program is correct: there is no mysql.sock anywhere in the system. I did a fresh install of mysql and it is not being created. I have searched the mysql.org site and there is no help that I could find.

The strange thing is that this is an all of a sudden thing. Mysql was working fine, then for no reason that I can determine these problems started.

Another thing, it was recommended to run mysql-test-run.pl. Well, I would like to but where is this program available? There is a man page on it but not even the mysql.org site indicates where it can be downloaded. Googling does not help either.

Do you have any suggestions?

My OS is Slackware 13.1 64bit.
 
Old 11-03-2010, 05:33 PM   #13
jrecortel
Member
 
Registered: Sep 2008
Location: Philippines
Distribution: slackware, FreeBSD
Posts: 123

Rep: Reputation: 19
instructions i followed when i configured LAMP in my Slackware 13.0. might be useful to you.
http://www.linuxquestions.org/questi...12-2-a-693708/
 
Old 11-04-2010, 09:49 AM   #14
mpagnan
Member
 
Registered: Apr 2003
Location: Canada
Distribution: Mint KDE 18.2
Posts: 33

Rep: Reputation: 5
Quote:
Originally Posted by jrecortel View Post
instructions i followed when i configured LAMP in my Slackware 13.0. might be useful to you.
http://www.linuxquestions.org/questi...12-2-a-693708/
Absolutely great! I feel LAMP empowered! What else can you do?
 
  


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
Issue with PHP And MySql ??? ajeetraina Linux - General 2 02-21-2008 11:21 PM
Buzilla issue: "Can't connect to local MySQL server through socket '/tmp/mysql.sock'" vitopn Linux - General 3 05-21-2007 10:13 AM
Php mysql issue petenyce Linux - Software 4 09-23-2005 02:39 AM
mysql issue.... SlakAdyct Slackware 6 10-23-2004 08:40 PM
mySQL issue Micah Linux - Software 6 08-27-2002 07:58 AM

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

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