LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Problem on installing MySQL (https://www.linuxquestions.org/questions/linux-server-73/problem-on-installing-mysql-594094/)

satimis 10-23-2007 11:54 PM

Problem on installing MySQL
 
Hi folks,


Ubuntu 7.04 server amd64
MySQL 5.0.38


On installing MySQL and coming to;

$ sudo mysqladmin -h ubuntu.xyz.com root password myrootsqlpassword
Code:

mysqladmin: connect to server at 'ubuntu.satimis.com' failed
error: 'Lost connection to MySQL server at 'reading initial communication packet', system error: 111'

$ hostname -f
Code:

ubuntu.xyz.com
$ ps aux | grep mysql
Code:

root      4557  0.0  0.0  3860  572 ?        S    20:35  0:00 /bin/sh /usr/bin/mysqld_safe
mysql    4599  0.0  1.0 160556 21992 ?        Sl  20:35  0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
root      4600  0.0  0.0  3768  576 ?        S    20:35  0:00 logger -p daemon.err -t mysqld_safe -i -t mysqld
satimis  5133  0.0  0.0  5028  828 pts/1    S+  21:15  0:00 grep mysql


$ cat /var/log/daemon.log | grep 111
No printout

$ cat /var/log/messages | grep 111
Code:

Oct 23 08:54:28 ubuntu kernel: [  24.857900] ata2.00: ATA-7: Maxtor 6V160E0, VA111900, max UDMA/133
Oct 23 08:54:28 ubuntu kernel: [  33.667111] i2c_adapter i2c-1: nForce2 SMBus adapter at 0x1c40
Oct 23 09:50:31 ubuntu kernel: [  23.021112] io scheduler cfq registered (default)
Oct 23 09:50:31 ubuntu kernel: [  25.185695] ata2.00: ATA-7: Maxtor 6V160E0, VA111900, max UDMA/133
Oct 23 09:50:31 ubuntu kernel: [  27.717111] sd 1:0:0:0: Attached scsi disk sda
Oct 23 09:50:31 ubuntu kernel: [  33.805111] ACPI: PCI Interrupt Link [AAZA] enabled at IRQ 21
Oct 23 19:05:48 ubuntu kernel: [  25.327627] ata2.00: ATA-7: Maxtor 6V160E0, VA111900, max UDMA/133
Oct 23 19:43:21 ubuntu kernel: [  22.142111] ACPI: PCI Interrupt Link [LNK8] (IRQs 5 7 9 10 11 14 15) *0, disabled.
Oct 23 19:43:21 ubuntu kernel: [  25.058170] ata2.00: ATA-7: Maxtor 6V160E0, VA111900, max UDMA/133
Oct 23 19:43:21 ubuntu kernel: [  33.379111] i2c_adapter i2c-0: nForce2 SMBus adapter at 0x1c00
Oct 23 20:35:27 ubuntu kernel: [  24.573772] ata2.00: ATA-7: Maxtor 6V160E0, VA111900, max UDMA/133

Please advise which log file I have to check? How to fix this problem? TIA


B.R.
satimis

jschiwal 10-24-2007 01:44 AM

You can get the exact error message if the mysqld service isn't running.

Check the connection with:
telnet ubuntu.xyz.com 3306

and

telnet localhost 3306

Is the connection rejected outright, or after a timeout?

satimis 10-24-2007 02:15 AM

Quote:

Originally Posted by jschiwal (Post 2934588)
You can get the exact error message if the mysqld service isn't running.

Check the connection with:
telnet ubuntu.xyz.com 3306

and

telnet localhost 3306

Is the connection rejected outright, or after a timeout?

Thanks for your advice.


$ telnet ubuntu.xyz.com 3306
Code:

Trying 127.0.1.1...
telnet: Unable to connect to remote host: Connection refused

$ telnet localhost 3306
Code:

Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection timed out

What is port 3306?

$ cat /etc/mysql/my.cnf | grep 127.0.0.1
Code:

bind-address            = 127.0.0.1
# ndb-connectstring=127.0.0.1

Shall I comment it out? In doing so will it affect the running of bind9?


TIA


B.R.
satimis

jschiwal 10-24-2007 06:31 AM

3306 is the default port that mysql uses. According to your ps listing it is what your machine uses.

Please double check that the mysql server is running. And try the telnet command locally on the same machine. If you do it remotely you need to check the firewall settings.

The bind address has a different meaning here. This just means that the server is connected to a socket on localhost. That is normal.

I think that the mysql log in in the /var/lib/mysql/ directory.

satimis 10-24-2007 10:19 AM

Quote:

Originally Posted by jschiwal (Post 2934802)
3306 is the default port that mysql uses. According to your ps listing it is what your machine uses.

Noted with thanks.


Quote:

Please double check that the mysql server is running.
$ sudo /etc/init.d/mysql status
Code:

* /usr/bin/mysqladmin  Ver 8.41 Distrib 5.0.38, for pc-linux-gnu on x86_64
Copyright (C) 2000-2006 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version          5.0.38-Ubuntu_0ubuntu1.1-log
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket            /var/run/mysqld/mysqld.sock
Uptime:                10 min 24 sec

Threads: 1  Questions: 136  Slow queries: 0  Opens: 132  Flush tables: 1  Open tables: 17  Queries per second avg: 0.218

Please advise if you need me to run other commands for checking mysql status.


Quote:

And try the telnet command locally on the same machine. If you do it remotely you need to check the firewall settings.
I tried telnet on the same machine.


Tried again on the same machine with firewall stopped.

$ sudo iptables -F
No complaint.

$ telnet ubuntu.xyz.com 3306
Code:

Trying 127.0.1.1...
telnet: Unable to connect to remote host: Connection refused

$ telnet localhost 3306
Code:

Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
Connection closed by foreign host.


Quote:

I think that the mysql log in in the /var/lib/mysql/ directory.
$ ls /var/lib/mysql
Code:

debian-5.0.flag  ibdata1  ib_logfile0  ib_logfile1  mysql  mysql_upgrade_info
$ ls /var/lib/mysql/mysql
Code:

columns_priv.frm  help_relation.MYI  time_zone_leap_second.frm
columns_priv.MYD  help_topic.frm    time_zone_leap_second.MYD
columns_priv.MYI  help_topic.MYD    time_zone_leap_second.MYI
db.frm            help_topic.MYI    time_zone.MYD
db.MYD            host.frm          time_zone.MYI
db.MYI            host.MYD          time_zone_name.frm
func.frm          host.MYI          time_zone_name.MYD
func.MYD          proc.frm          time_zone_name.MYI
func.MYI          proc.MYD          time_zone_transition.frm
help_category.frm  proc.MYI          time_zone_transition.MYD
help_category.MYD  procs_priv.frm    time_zone_transition.MYI
help_category.MYI  procs_priv.MYD    time_zone_transition_type.frm
help_keyword.frm  procs_priv.MYI    time_zone_transition_type.MYD
help_keyword.MYD  tables_priv.frm    time_zone_transition_type.MYI
help_keyword.MYI  tables_priv.MYD    user.frm
help_relation.frm  tables_priv.MYI    user.MYD
help_relation.MYD  time_zone.frm      user.MYI

Seems it is not there.


Others noted with thanks.


satimis

jschiwal 10-24-2007 01:30 PM

My mysql log is in /var/lib/mysql and not /var/lib/mysql/mysql. The latter is where the tables are stored.

Did you try to log into mysql either without the -h option or using "-h localhost"? That is the one that may work and if you can access it that way, you can add your hostname and a regular user.
Use, "mysql -u root", if you haven't added a password for root;
mysql -u root -p
<password>
otherwise.

---
Quote:

Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
This indicates that using localhost at least that the connection isn't rejected outright.
Could you check if /etc/hosts.allow or /etc/hosts.deny are causing a problem.

Also check your /etc/hosts file. I've seen where "localhost" uses an IPV6 type address near the end of the file. Check that the first uncommented line is "127.0.0.1 localhost". If not you could have problems it you edit /etc/hosts.allow or /etc/hosts.deny.

satimis 10-24-2007 08:27 PM

Quote:

Originally Posted by jschiwal (Post 2935342)
My mysql log is in /var/lib/mysql and not /var/lib/mysql/mysql. The latter is where the tables are stored.

Did you try to log into mysql either without the -h option or using "-h localhost"? That is the one that may work and if you can access it that way, you can add your hostname and a regular user.
Use, "mysql -u root", if you haven't added a password for root;
mysql -u root -p
<password>
otherwise.

I'm trying to find mysql log file in order to discover the cause of problem in running "mysqladmin -h ubuntu.xyz.com root password myrootsqlpassword"

I followed this link to proceed;
SHOW mysqld LOG FILES;
http://dev.mysql.com/doc/refman/5.0/...-commands.html

$ mysql --user=root --password=mysqlpassword
Code:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.0.38-Ubuntu_0ubuntu1.1-log Ubuntu 7.04
distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SHOW mysql LOG FILES;
ERROR 1064 (42000): You have an error in your SQL
syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near 'mysql LOG
FILES' at line 1

Read "man mysql". The syntax is correct. It generates another problem. I can't figure out how to correct it. Any advice? TIA.


# find / -name mysql.log
Code:

/var/log/mysql.log

But it is an empty file;
# cat /var/log/mysql.log
No printout


Quote:

This indicates that using localhost at least that the connection isn't rejected outright.
Could you check if /etc/hosts.allow or /etc/hosts.deny are causing a problem.

Also check your /etc/hosts file. I've seen where "localhost" uses an IPV6 type address near the end of the file. Check that the first uncommented line is "127.0.0.1 localhost". If not you could have problems it you edit /etc/hosts.allow or /etc/hosts.deny.
$ cat /etc/hosts.allow
Code:

sshd: 127.0.0.1

# Domain
sshd: .xyz.com

# Pacific from home
sshd: *.myISP.com

sshd sshd1 sshd2 : ALL : ALLOW


$ cat /etc/hosts.deny
Code:

sshd:ALL EXCEPT localhost \
: spawn /bin/echo `/bin/date` access denied for %a %h>>/var/log/sshd.log

ALL:ALL

$ cat /etc/hosts
Code:

127.0.0.1      localhost.localdomain  localhost
127.0.1.1      ubuntu.xyz.com      ubuntu

# The following lines are desirable for IPv6 capable hosts
::1    ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


B.R.
satimis


All times are GMT -5. The time now is 10:18 PM.