HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=4)
-   -   Problem installing MySQL on suse 10.3 (http://www.howtoforge.com/forums/showthread.php?t=22357)

Txchaser 15th April 2008 19:08

Problem installing MySQL on suse 10.3
 
This is now the 3rd time I have wiped out and done a clean install of suse and keep running into the same poroblem when trying to install mysql.
I get as far as inputting the admin. pass once i try to add the admin pass I get the following error:

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

As far as I know mysql is running as it has been stopped then restarted with no errors. I also have checked to see if the mysql.sock file is in the directory in which it is not. Here Is what is in the directory:

svr1:~ # cd /var/lib/mysql
svr1:/var/lib/mysql # dir
total 20540
drwx------ 2 mysql mysql 4096 Apr 10 09:58 .protected
-rw-r--r-- 1 mysql mysql 0 Apr 15 12:51 .run-mysql_upgrade
drwxr-xr-x 2 mysql mysql 4096 Apr 10 09:58 .tmp
-rw-rw---- 1 mysql mysql 5242880 Apr 15 12:42 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 Apr 15 12:41 ib_logfile1
-rw-rw---- 1 mysql mysql 10485760 Apr 15 12:42 ibdata1
drwx------ 2 mysql mysql 4096 Apr 15 12:41 mysql
-rw-rw---- 1 mysql mysql 1041 Apr 15 12:41 mysqld.log
drwx------ 2 mysql mysql 4096 Apr 15 12:40 test

I have noticed searching through the various sites that there seems to be quite a few people with the same problem, I just could not find a clear solution to the problem any help would be appreciated. Without this being resolved I can not continue my installation.

o.meyer 15th April 2008 19:28

Hi Txchaser,

please paste the output of

Code:

cat /etc/my.cnf
Best regards,

Olli

Txchaser 15th April 2008 19:33

thanks for reply heres the output you were wanting
 
svr1:~ # cat /etc/my.cnf
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# 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/lib/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

# 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!
#

# 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 = 4M
#bdb_max_lock = 10000

# 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 = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

# The safe_mysqld script
[safe_mysqld]
log-error=/var/lib/mysql/mysqld.log

[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 = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

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

[mysqlhotcopy]
interactive-timeout

[mysqld_multi]
mysqld = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
log = /var/log/mysqld_multi.log
# user = multi_admin
# password = secret

# If you want to use mysqld_multi uncomment 1 or more mysqld sections
# below or add your own ones.

# WARNING
# --------
# If you uncomment mysqld1 than make absolutely sure, that database mysql,
# configured above, is not started. This may result in corrupted data!
# [mysqld1]
# port = 3306
# datadir = /var/lib/mysql
# pid-file = /var/lib/mysql/mysqld.pid
# socket = /var/lib/mysql/mysql.sock
# user = mysql

# [mysqld2]
# port = 3307
# datadir = /var/lib/mysql-databases/mysqld2
# pid-file = /var/lib/mysql-databases/mysqld2/mysql.pid
# socket = /var/lib/mysql-databases/mysqld2/mysql.sock
# user = mysql

# [mysqld3]
# port = 3308
# datadir = /var/lib/mysql-databases/mysqld3
# pid-file = /var/lib/mysql-databases/mysqld3/mysql.pid
# socket = /var/lib/mysql-databases/mysqld3/mysql.sock
# user = mysql

# [mysqld6]
# port = 3309
# datadir = /var/lib/mysql-databases/mysqld6
# pid-file = /var/lib/mysql-databases/mysqld6/mysql.pid
# socket = /var/lib/mysql-databases/mysqld6/mysql.sock
# user = mysql

svr1:~ #

o.meyer 15th April 2008 20:05

Hi Txchaser,

taken from the MySQL troubleshooting page:

"[...]You also need to ensure that clients have permission to access the mysql.sock file.[...]"

So it might be a problem with the rights. Please paste the output of

Code:

ls -la /var/lib/mysql/
Best regards,

Olli

Txchaser 15th April 2008 20:08

output of ls -la /var/lib/mysql/
 
svr1:~ # ls -la /var/lib/mysql/
total 20548
drwxr-xr-x 6 mysql mysql 4096 Apr 10 09:58 .
drwxr-xr-x 29 root root 4096 Apr 15 11:02 ..
drwx------ 2 mysql mysql 4096 Apr 10 09:58 .protected
-rw-r--r-- 1 mysql mysql 0 Apr 15 12:51 .run-mysql_upgrade
drwxr-xr-x 2 mysql mysql 4096 Apr 10 09:58 .tmp
-rw-rw---- 1 mysql mysql 5242880 Apr 15 12:42 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 Apr 15 12:41 ib_logfile1
-rw-rw---- 1 mysql mysql 10485760 Apr 15 12:42 ibdata1
drwx------ 2 mysql mysql 4096 Apr 15 12:41 mysql
-rw-rw---- 1 mysql mysql 1041 Apr 15 12:41 mysqld.log
drwx------ 2 mysql mysql 4096 Apr 15 12:40 test

o.meyer 15th April 2008 20:23

Sorry, I read over that no socket was created on your system. Are you sure that the mysql server is running? What is the output of

Code:

netstat -ln | grep mysql
and

Code:

netstat -tap | grep mysql
Best regards,

Olli

Txchaser 15th April 2008 20:30

thanks for fast replies :)
 
svr1:~ # netstat -tap | grep mysql
svr1:~ #

This is all I get. Im not sure what is going on, I forgot to mention that this was another problem as well on one of the other installs I tried. It is acting like it is not running. I have tried /etc/init.d/mysql start to start it and then run netstat -tap | grep mysql and still get nothing. I have also tried /etc/init.d/mysql restart to restart it and it says it terminates and then restarts but still get nothing from netstat -tap | grep mysql. Each install that I have done I have followed falkos tutorial and made sure I havent missed anything.

o.meyer 15th April 2008 22:26

The mysql server is not running. Have you looked into the mysql-log?

Best regards,

Olli

Txchaser 15th April 2008 22:37

hope this was the correct log file
 
mysqld log:
080415 12:41:23 mysqld started

InnoDB: The first specified data file ./ibdata1 did not exist:

InnoDB: a new database to be created!

080415 12:41:23 InnoDB: Setting file ./ibdata1 size to 10 MB

InnoDB: Database physically writes the file full: wait...

080415 12:41:28 InnoDB: Log file ./ib_logfile0 did not exist: new to
be created

InnoDB: Setting log file ./ib_logfile0 size to 5 MB

InnoDB: Database physically writes the file full:
wait...

080415 12:41:31 InnoDB: Log file ./ib_logfile1 did not exist: new to
be created

InnoDB: Setting log file ./ib_logfile1 size to 5 MB

InnoDB: Database physically writes the file full: wait...

InnoDB: Doublewrite buffer not found: creating new

InnoDB: Doublewrite buffer created

InnoDB: Creating foreign key constraint system tables

InnoDB: Foreign key constraint system tables created

080415 12:41:57
InnoDB: Started; log sequence number 0 0
080415 12:41:57
[Note] /usr/sbin/mysqld: ready for connections.

Version: '5.0.45' socket: '/var/lib/mysql/.protected/mysql.sock'
port: 0 SUSE MySQL RPM


everything that I have been trying to do i noticed that it is looking for mysql.sock in this directory "/var/lib/mysql/" and it is actually in '/var/lib/mysql/.protected/mysql.sock' I con not move it from that directory for some reason.
Also by reading this log am I correct by assuming that it is set to port 0 and when I am running the connection it is looking for connection port of 3060 I belive is what it was?

o.meyer 16th April 2008 01:18

Hi Txchaser,

please try the following - in the my.cf ...

change:

Code:

socket = /var/lib/mysql/mysql.sock
to:

Code:

socket = /var/lib/mysql/.protected/mysql.sock
After that restart/start the mysql server and check again if it is running wit the both netstat commands.

Best regards,

Olli


All times are GMT +2. The time now is 04:18.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.