PDA

View Full Version : MySQL



mzee
08-04-2003, 06:07 PM
Am not able to start the DVD MySQL. Getting following messages:
QUOTE
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysq
ld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
UNQUOTE
And indeed : ther is no '/var/run/mysqld/mysqld.sock'
Do not experience the same problem with hte "2003/07/26" CD.

Any help or hint?

Thank you!

Georges.

Edwin
08-04-2003, 07:17 PM
I am not familiair with the DVD version, but does it start the mysql daemon automaticly at boot? Or do you start it manually? If the first go through the boot messages with 'dmesg' in a console. Look for error messages. If the last, what does it say after you start it?

Also check if the deamon is running with 'ps -A | grep mysql'. If this returns some processes have a look at /var/log/mysql/mysql.err (as root). Do you have a mysql.pid file in /var/run/mysqld?

HTH

- - Edwin

kaplanfx
08-04-2003, 08:42 PM
if MySQL does not start automatically you can usually start it with a script in /etc/init.d/ look in that folder for mysql or mysqld. If either is there, su to root and type: /etc/init.d/mysql start or /etc/init.d/mysqld start depending on which file you found, this should start mysql server and allow you to connect.

mzee
08-05-2003, 10:24 AM
Thank you for prompt reaction.

The problem is the DVD! With the 2003.06.06 and 2003-07-26 CD's I can start MySQL.

I start MySQL manually in a konsole : sudo /etc/init.d/mysql start
With the 2003-07-10 DVD the error messages I quoted appear in the error-file : "/var/log/mysql/mysql.err "

Another question : can you add another user (not 'root') with MySQL under Knoppix? I was unable to do so.

By the way : what means ' HTH'? Apologizing for my ignorance ...

Thanks beforehand for more hints and help on MySQL - Knoppix.

Dank!

Regards,

Georges.

Edwin
08-05-2003, 12:43 PM
I start MySQL manually in a konsole : sudo /etc/init.d/mysql start
With the 2003-07-10 DVD the error messages I quoted appear in the error-file : "/var/log/mysql/mysql.err "

Odd. I tried this command on a 20030726 CD boot. No errors in the console, but the error-log showed:


030805 13:00:35 Error at /etc/init.d/mysql\n/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
030805 13:00:35 mysqld started
Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line
/usr/sbin/mysqld: ready for connections.
Version: '4.0.13-log' socket: '/var/run/mysqld/mysqld.sock' port: 0

As you can see the same errors, but MySql is started. Maybe this command is not the right way to start the server (the man page does not list the 'start' command). I always use 'sudo mysqld' (full path: /usr/sbin/mysqld). Try that and see if it helps.


Another question : can you add another user (not 'root') with MySQL under Knoppix? I was unable to do so.

It did work for me with 'mysqladmin'. Check the permissions on the databasefiles in /var/lib/mysql/mysql.

Hope This Helps (HTH)

- - Edwin

mzee
08-05-2003, 06:09 PM
Indeed, very odd. With the 20030726 CD and the 20020606 CD I get the same errorfile and MySQL starts. Whereas with the DVD I get the same errorfile but MySQL does not start.

According to my info : 'sudo /etc/init.d/mysql start' is the right way to start.
I also tried your : /usr/sbin/mysqld. With the follwing error :
QUOTE
Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' earlier on the command line
030805 18:55:27 Fatal error: Can't open privilege tables: Incorrect information in file: './mysql/host.frm'
030805 18:55:27 Aborting
UNQUOTE

Dank.

Regards,

Georges.

Edwin
08-05-2003, 06:40 PM
030805 18:55:27 Fatal error: Can't open privilege tables: Incorrect information in file: './mysql/host.frm'
030805 18:55:27 Aborting


So you have a corrupt table. The file host.frm holds the description (format) for the mysql.host table. This table is used to stores the privileges at the host level.

Worth a shot: copy the three files which make up this table from a CD version to /var/lib/mysql/mysql in the DVD-version and set the permissions to rwx for everyone. The table is empty so it fits on a floppy easily. See what happens. Use the 'mysqld' command as it seems to give some usefull information.

Succes

- - Edwin

paradocs
08-07-2003, 04:25 AM
Hi mzee,
Hi All,

I have the original test DVD which is likely the same
as the Linux Tag version.

I run the DVD - not installed - and it apears to work.
Yes, I get the same entry in /mysql.err
but

mysql
and enter gives the prompt
mysql>
and
mysql> SELECT VERSION();
responds wth a table showing 4.0.13-log

Did you do a hard drive install, are you working
from the DVD, or from the DVD image copied to a hard drive?

Best Wishes
paradocs

mzee
08-07-2003, 01:04 PM
Thank you for kind reactions.

Edwin, followed your advice and tried to copy the 'host.*'-files. But since I am working from the DVD got following message:
'
sudo cp -f /mnt/floppy/host.frm /KNOPPIX/var/lib/mysql/mysql
cp: cannot remove `/KNOPPIX/var/lib/mysql/mysql/host.frm': Read-only file system
'
Tried also a symbolic link : to no avail ...
sudo ln -s ./sql/host.frm /var/lib/mysql/mysql/host.frm

As for Paradocs, tried to enter mysql but :
'
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
'

Anyway, thank your for kind attention,

Regards,

Georges.

Edwin
08-07-2003, 08:16 PM
This is getting odder by the day. You might be right there is something wrong with your DVD. Here is what I did: I made a simple text file and put it on a floppy as 'host.frm' Then I booted a 20030726 CD. Opened a shell and:


knoppix@ttyp0[knoppix]$ sudo cp -f /mnt/floppy/host.frm /var/lib/mysql/mysql
knoppix@ttyp0[knoppix]$ ls /var/lib/mysql/mysql | grep host
host.MYD
host.MYI
host.frm
knoppix@ttyp0[knoppix]$ cat /var/lib/mysql/mysql/host.frm
This is a test file
This is not a MySql-table-description file
knoppix@ttyp0[knoppix]$

In other words: operation succeeded. As it should have for the /var directory is stored on a RAM-disk. It holds the databases, so one should be able to write to it.

But here is the funny part. I rebooted in a root-account (there is a handy tip on the Tips forum on how to do that). Opened a shell and:


root@0[root]# cp -f /mnt/floppy/host.frm /var/lib/mysql/mysql
cp: overwrite `/var/lib/mysql/mysql/host.frm', overriding mode 0660? y
cp: skipping file `/mnt/floppy/host.frm', as it was replaced while being copied
root@0[root]# cat /var/lib/mysql/mysql/host.frm

The output from the last command clearly showed that the copy had failed. Good, not the same error as you had, but getting close. So next I did:


root@0[root]# mv /var/lib/mysql/mysql/host.frm /var/lib/mysql/mysql/host.frm.old
root@0[root]# cp /mnt/floppy/host.frm /var/lib/mysql/mysql
root@0[root]# ls /var/lib/mysql/mysql | grep host
host.MYD
host.MYI
host.frm
host.frm.old
root@0[root]# cat /var/lib/mysql/mysql/host.frm
This is a test file
This is not a MySql-table-description file
root@0[root]#

So first renaming and then copying works here. You might want to give this a try, as Knoppix (using sudo) or as root. Apart from that I am out of options.

Maybe the gentleman offering DVD's in this forum can shed some light?

Regards,

- - Edwin

paradocs
08-08-2003, 04:19 AM
Greeting mezz et al.

My first thought was that perhaps the heat wave is getting to them over there. Check to be sure the DVD is not melting, reboot -- no better shut down and let it cool off for 1 hour -- take a cold shower ... :D

Sorry you have to put up with my humor.

Thy this method:
Open one shell and type
su
mysqld
The shell will hang up but that is expected. Leave it open.
Now open a new shell and type
mysql
You should see
mysql>
Best Wishes
paradocs

mzee
08-08-2003, 01:46 PM
Thy this method:
Open one shell and type
su
mysqld
The shell will hang up but that is expected. Leave it open.
Now open a new shell and type
mysql
You should see
mysql>


Thanks for humor, paradocs!!. Yes, it has been rather hot around here... But even your best wishes do not help! Get still the same message :
'
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
'
I think there is something rotten in the state of Knoppix DVD and MySQL ...

Edwin, I agree with you : odder and odder. See what I get when I start MySQL on the 2003-07-26 CD
'
sudo less /ramdisk/var/log/mysql/mysql.err
30808 11:23:47 Error at /KNOPPIX/etc/init.d/mysql\n^G/usr/bin/mysqladmin: conn
ect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysq
ld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock'
exists!
030808 11:23:47 mysqld started
030808 11:23:48 Error at /KNOPPIX/etc/init.d/mysql\n^G/usr/bin/mysqladmin: conn
ect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysq
ld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock'
exists!
Warning: Ignoring user change to 'mysql' because the user was set to 'mysql' ear
lier on the command line
/usr/sbin/mysqld: ready for connections.
Version: '4.0.13-log' socket: '/var/run/mysqld/mysqld.sock' port: 0
'
But for the rest everything goes fine ...

Wishing you all the best as well!

Regards,

Georges.

Edwin
08-08-2003, 06:49 PM
mzee,

I only spotted this just now (must be the heat), so I give it another try.

When attempting to copy the host.* files you used:


sudo cp -f /mnt/floppy/host.frm /KNOPPIX/var/lib/mysql/mysql
cp: cannot remove `/KNOPPIX/var/lib/mysql/mysql/host.frm': Read-only file system

You used '/KNOPPIX' as root for the destination where I used '/' This is a session from a CD boot:


knoppix@ttyp0[knoppix]$ sudo cp -f /mnt/floppy/host.frm /KNOPPIX/var/lib/mysql/mysql
cp: cannot remove `/KNOPPIX/var/lib/mysql/mysql/host.frm': Read-only file system
knoppix@ttyp0[knoppix]$ cat /KNOPPIX/var/lib/mysql/mysql/host.frm
cat: /KNOPPIX/var/lib/mysql/mysql/host.frm: Permission denied
knoppix@ttyp0[knoppix]$ sudo cp -f /mnt/floppy/host.frm /var/lib/mysql/mysql
knoppix@ttyp0[knoppix]$ cat /var/lib/mysql/mysql/host.frm
This is a test file
This is not a MySql-table-description file
knoppix@ttyp0[knoppix]$

I don't know what this '/KNOPPIX' is (on the CD?) but we are clearly not supposed to mess with it. Using plain '/' as root works BTW. After my little sabotage-act MySql wouldn't start, complaining about incorrect information in host.frm.

Regards,

- - Edwin

mzee
08-08-2003, 08:07 PM
This is a session from a CD boot:


knoppix@ttyp0[knoppix]$ sudo cp -f /mnt/floppy/host.frm /KNOPPIX/var/lib/mysql/mysql
cp: cannot remove `/KNOPPIX/var/lib/mysql/mysql/host.frm': Read-only file system
knoppix@ttyp0[knoppix]$ cat /KNOPPIX/var/lib/mysql/mysql/host.frm
cat: /KNOPPIX/var/lib/mysql/mysql/host.frm: Permission denied
knoppix@ttyp0[knoppix]$ sudo cp -f /mnt/floppy/host.frm /var/lib/mysql/mysql
knoppix@ttyp0[knoppix]$ cat /var/lib/mysql/mysql/host.frm
This is a test file
This is not a MySql-table-description file
knoppix@ttyp0[knoppix]$


Thank you for keeping on!

I followed your advice but with the same results :
'
030808 20:54:05 Error at /KNOPPIX/etc/init.d/mysql\n^G/usr/bin/mysqladmin: conn
ect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysq
ld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock'
exists!
030808 20:54:06 Error at /KNOPPIX/etc/init.d/mysql\n^G/usr/bin/mysqladmin: conn
ect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysq
ld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock'
exists!
'
Suggest we drop the subject. The Knoppix LinuxTag DVD is nice but MySQL on it doesn't work ....

Happily MySQL works with the 20030606 and 20030726 Live CD's, although in a strange way : see my previous mail.

Wish to thank you and the others for kind attention.

Best Regards,

Georges.

MDURAND
06-07-2005, 09:19 PM
I am not familiair with the DVD version, but does it start the mysql daemon automaticly at boot? Or do you start it manually? If the first go through the boot messages with 'dmesg' in a console. Look for error messages. If the last, what does it say after you start it?

Also check if the deamon is running with 'ps -A | grep mysql'. If this returns some processes have a look at /var/log/mysql/mysql.err (as root). Do you have a mysql.pid file in /var/run/mysqld?

HTH

- - Edwin

Hi, yo tambien tengo el mismo error.
Y no, no tengo el mysql.pid...
No se cual pueda ser el probelma.
Slds

Wolfixx
09-21-2005, 10:01 PM
Hi,

I just downloaded the 4.0.1 DVD version of knoppix and have the same problems to run mysql

As there is no mysqld_safe file on the system, i tried to start it via "/etc/init.d/mysql start" as root. There must be a problem in this compilation

Starting MySQL database server: mysqld...failed.
Please take a look at the syslog.
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

If I tried to start via mysqld_safe I get the following:
root@3[www]# Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[14763]: started
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[14769]: ended


Does anyone have a solution now for that?

Thanks,
Wolfixx

impf
10-11-2005, 04:39 PM
You have to edit /etc/mysql/my.cnf

Uncomment the line with: old_passwords = 1

Wolfixx
10-12-2005, 08:48 AM
Hi Impf,

Thank you very much; now it works

Wolfixx