SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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
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.
Unfortunately I didn't have any success. Here are my results.
mysqld_safe --user=mysql 2>&1 >/dev/null &
Code:
[1] 3432
root@slackfractals:/home# nohup: ignoring input and redirecting stderr to stdout
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
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.
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.
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:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.