Installing MySQL system tables... ERROR: 1004 Can't create file '/tmp/

Z Podręcznik Administratora by OPZ SGU
Przejdź do nawigacji Przejdź do wyszukiwania

Podczas próby instalacji (środowiska roboczego) bazy danych mysql, powitał mnie taki komunikat.

cd /usr/local/mysql
dokasacji:/usr/local/mysql# bin/mysql_install_db --user=mysql
Installing MySQL system tables...
ERROR: 1004  Can't create file '/tmp/#sql2d58_1_0.frm' (errno: 9)
101109  8:21:31 [ERROR] Aborting

101109  8:21:31 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete

Installation of system tables failed!  Examine the logs in
/usr/local/mysql/var for more information.

You can try to start the mysqld daemon with:

    shell> /usr/local/mysql/libexec/mysqld --skip-grant &

and use the command line tool /usr/local/mysql/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /usr/local/mysql/bin/mysql -u root mysql
    mysql> show tables

Try 'mysqld --help' if you have problems with paths.  Using --log
gives you a log in /usr/local/mysql/var that may be helpful.

Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS.  Another information source are the
MySQL email archives available at

Please check all of the above before mailing us!  And remember, if
you do mail us, you MUST use the /usr/local/mysql/bin/mysqlbug script!

Z błędu bezpośrednio wynikało, iż winowajcą jest brak możliwosci zapisu do /tmp.

W tym celu udałem się do / i wylistowałem uprawnienia folderu tmp

drwxrwxrwt  4 root root  4096 Nov  9 08:24 tmp

Uprawnienia były poprawne...

Zabrałem się więc za temat z drugiej strony.

cd /usr/local/mysql
chown -R mysql .
chgrp -R mysql .

I wykonalem ponownie "initializacje"

bin/mysql_install_db --user=mysql
Installing MySQL system tables...
Filling help tables...

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

To do so, start the server, then issue the following commands:

/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h dokasacji password 'new-password'

Alternatively you can run:

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/local/mysql ; /usr/local/mysql/bin/mysqld_safe &

You can test the MySQL daemon with
cd /usr/local/mysql/mysql-test ; perl

Please report any problems with the /usr/local/mysql/bin/mysqlbug script!

Sukces :)