Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 28960 - Unable to set grant tables in mysql
Summary: Unable to set grant tables in mysql
Status: VERIFIED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Gentoo Linux MySQL bugs team
URL: http://forums.gentoo.org/viewtopic.ph...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-17 03:48 UTC by Ioannis Aslanidis (RETIRED)
Modified: 2006-05-24 06:35 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ioannis Aslanidis (RETIRED) gentoo-dev 2003-09-17 03:48:03 UTC
I emerge mysql normally, but cannot create the grant tables in any way:
I run 
#mysql_install_db 
and it seems to generate them, but it doesn't!
When I start the server, it automatically crashes and I have to zap it in order
to stop it.
The only way I found to start the server without trouble is doing 
#mysqld_safe --skip-grant-tables &
but I'm unsure on how to make the tables that manually. This is described:

mysqld crashes immediately
    If you are running Red Hat Version 5.0 with a version of glibc older than
2.0.7-5, you should make sure you have installed all glibc patches. There is a
lot of information about this in the MySQL mail archives. Links to the mail
archives are available online at http://lists.mysql.com/. Also, see section
2.6.2 Linux Notes (All Linux Versions). You can also start mysqld manually using
the --skip-grant-tables option and add the privilege information yourself using
mysql:

shell> BINDIR/mysqld_safe --skip-grant-tables &
shell> BINDIR/mysql -u root mysql

    From mysql, manually execute the SQL commands in mysql_install_db. Make sure
you run mysqladmin flush-privileges or mysqladmin reload afterward to tell the
server to reload the grant tables.

** Bellow everything that I checked: **


Comment 1 Ioannis Aslanidis (RETIRED) gentoo-dev 2003-09-17 03:48:03 UTC
I emerge mysql normally, but cannot create the grant tables in any way:
I run 
#mysql_install_db 
and it seems to generate them, but it doesn't!
When I start the server, it automatically crashes and I have to zap it in order
to stop it.
The only way I found to start the server without trouble is doing 
#mysqld_safe --skip-grant-tables &
but I'm unsure on how to make the tables that manually. This is described:

mysqld crashes immediately
    If you are running Red Hat Version 5.0 with a version of glibc older than
2.0.7-5, you should make sure you have installed all glibc patches. There is a
lot of information about this in the MySQL mail archives. Links to the mail
archives are available online at http://lists.mysql.com/. Also, see section
2.6.2 Linux Notes (All Linux Versions). You can also start mysqld manually using
the --skip-grant-tables option and add the privilege information yourself using
mysql:

shell> BINDIR/mysqld_safe --skip-grant-tables &
shell> BINDIR/mysql -u root mysql

    From mysql, manually execute the SQL commands in mysql_install_db. Make sure
you run mysqladmin flush-privileges or mysqladmin reload afterward to tell the
server to reload the grant tables.

** Bellow everything that I checked: **


· etc-update didn't do anything.

· root@BlackHat lib # /usr/bin/mysqld_safe --user=mysql
Starting mysqld daemon with databases from /var/lib/mysql
030915 12:50:17  mysqld ended

·mysqld.err
030915 12:50:17  mysqld started
Warning: Ignoring user change to 'mysql' because the user was set to 'mysql'
earlier on the $
030915 12:50:17  Fatal error: Can't open privilege tables: Can't find file:
'./mysql/host.fr$
030915 12:50:17  Aborting

030915 12:50:17  /usr/sbin/mysqld: Shutdown Complete

030915 12:50:17  mysqld ended


· mysql.log & mysql.err are empy.

· root@BlackHat lib # ebuild /var/db/pkg/dev-db/mysql*/*.ebuild config
* Hmm, it appears as though you already have the mysql
* database in place.  If you are having problems trying
* to start mysqld, perhaps you need to manually run
* /usr/bin/mysql_install_db and/or check your config
* file(s) and/or database(s) and/or logfile(s).


· root@BlackHat lib # dmesg | grep socket
Initializing RT netlink socket
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.

And also I get: 

root@BlackHat bin # ./mysql_fix_privilege_tables
This scripts updates the mysql.user, mysql.db, mysql.host and the
mysql.func tables to MySQL 3.22.14 and above.

This is needed if you want to use the new GRANT functions,
CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23

If you get 'Access denied' errors, you should run this script again
and give the MySQL root user password as an argument!
Converting all privilege tables to MyISAM format
ERROR 1017 at line 1: Can't find file: './mysql/user.frm' (errno: 13)
ERROR 1017 at line 2: Can't find file: './mysql/db.frm' (errno: 13)
ERROR 1017 at line 3: Can't find file: './mysql/host.frm' (errno: 13)
ERROR 1017 at line 4: Can't find file: './mysql/func.frm' (errno: 13)
ERROR 1017 at line 5: Can't find file: './mysql/columns_priv.frm' (errno: 13)
ERROR 1017 at line 6: Can't find file: './mysql/tables_priv.frm' (errno: 13)


and even more errors of the same type.

Reproducible: Always
Steps to Reproduce:
1.emerge mysql
2.mysql_install_db
Actual Results:  
Unable to set up mysql to run correctly.

Expected Results:  
Grant tables should have been created and mysql started successfully.

Portage 2.0.49-r4 (default-x86-1.4, gcc-3.3.1, glibc-2.3.2-r1, 2.4.20-xfs-r3)
=================================================================
System uname: 2.4.20-xfs-r3 i686 AMD Athlon(tm) XP 1800+
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-mcpu=i686 -O3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config
/usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /opt/tomcat/conf
/usr/kde/3.1/share/config /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-mcpu=i686 -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="http://ftp.belnet.be/mirrors/rsync.gentoo.org/gentoo
http://gentoo.oregonstate.edu/
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="foomaticdb mad berkdb nas mysql gnome 3dnow aalib acpi apm arts avi cdr
crypt cups curl dga directfb doc dvb dvd emacs encode esd ethereal evo fbcon X
kde alsa zlib ipv6 firebird flash gb gd gdbm ggi gif gnomegphoto2 gpm gtk
gtkhtml guile icc imlib java jikes jpeg junit ladcca lcms leim libg++ libwww
mbox mikmod memlimit mmx motif mozilla mpeg mule ncurses nls oav oggvorbis
opengl oss pam pdflib perl plotutils png pnp prebuilt python qt quicktime
readline ruby samba scanner sdl slang slp spell ssl svga tcltk tcpd tetex tiff
truetype usb wmf xml xml2 xmms xv x86"
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-09-17 09:03:07 UTC
Don't run it manually.
look at the postinst message after mysql installs and use that "ebuild /var/db/pkg/dev-db/mysql-4*/mysql-4*.ebuild config" command to set up the initial table structure.

That crash shows you do not have the permissions set correctly on the tables, which is carried out by the ebuild config step.
Comment 3 Ioannis Aslanidis (RETIRED) gentoo-dev 2003-09-17 09:23:26 UTC
You hurried to resolve the bug as invalid... your resolution is the invalid one though...


root@BlackHat / # ebuild /var/db/pkg/dev-db/mysql-4.0.15/mysql-4.0.15.ebuild config
 * Hmm, it appears as though you already have the mysql
 * database in place.  If you are having problems trying
 * to start mysqld, perhaps you need to manually run
 * /usr/bin/mysql_install_db and/or check your config
 * file(s) and/or database(s) and/or logfile(s).
Comment 4 Ioannis Aslanidis (RETIRED) gentoo-dev 2003-09-17 09:24:32 UTC
Why don't you better tell me where are the tables located? I could try to remove them and re-run the config command.
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-09-17 12:33:40 UTC
rm -rf /var/lib/mysql 
then do the ebuild config step again 
 
 
your original posting is still invalid. 
you said: 
"I emerge mysql normally, but cannot create the grant tables in any way:" 
this indicates that the message telling you how to setup the tables (ebuild config) was 
ignored. 
Comment 6 Ioannis Aslanidis (RETIRED) gentoo-dev 2003-09-17 12:40:59 UTC
All right... thanks for your help and excuse my bad modals.
Comment 7 Luca Longinotti (RETIRED) gentoo-dev 2006-05-24 06:35:57 UTC
This seems to have been fixed, works here at least, and the bug is 3 years old... Closing now.
Best regards, CHTEKK.